]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add empty contents check for vape (#16123)
authorthemias <89101928+themias@users.noreply.github.com>
Fri, 5 May 2023 17:48:47 +0000 (13:48 -0400)
committerGitHub <noreply@github.com>
Fri, 5 May 2023 17:48:47 +0000 (10:48 -0700)
Content.Server/Nutrition/EntitySystems/SmokingSystem.Vape.cs
Resources/Locale/en-US/nutrition/components/vape-component.ftl

index 15661568f68475292a0d485a9c738a45d64a9381..07fb24cd2052049519db842e105c08a3f6c0cc19 100644 (file)
@@ -50,6 +50,14 @@ namespace Content.Server.Nutrition.EntitySystems
             || _foodSystem.IsMouthBlocked(args.Target.Value, args.User))
                 return;
 
+            if (solution.Contents.Count == 0)
+            {
+                _popupSystem.PopupEntity(
+                    Loc.GetString("vape-component-vape-empty"), args.Target.Value,
+                    args.User);
+                return;
+            }
+
             if (args.Target == args.User)
             {
                 delay = comp.UserDelay;
@@ -166,4 +174,4 @@ namespace Content.Server.Nutrition.EntitySystems
             args.Handled = true;
         }
        }
-}
\ No newline at end of file
+}
index 2d25e1a8deaed6e855f7c253949b7b0fa6861574..d43bd5ebcce468fba756bd0d87bdf10de9a97a31 100644 (file)
@@ -3,4 +3,5 @@ vape-component-vape-success-forced = {CAPITALIZE(THE($user))} forced you to puff
 vape-component-vape-success-user-forced = You successfully forced to puff {THE($target)}.
 vape-component-try-use-vape-forced = {CAPITALIZE(THE($user))} is trying to make you puff on the vape.
 vape-component-try-use-vape-forced-user = You are forcing {THE($target)} to puff on the vape.
-vape-component-try-use-vape = You are trying to puff on the vape.
\ No newline at end of file
+vape-component-try-use-vape = You are trying to puff on the vape.
+vape-component-vape-empty = The vape is empty!
\ No newline at end of file