From: themias <89101928+themias@users.noreply.github.com> Date: Fri, 5 May 2023 17:48:47 +0000 (-0400) Subject: Add empty contents check for vape (#16123) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=544d2a101051ac8ca761a30bec8de1c8b6220fa6;p=space-station-14.git Add empty contents check for vape (#16123) --- diff --git a/Content.Server/Nutrition/EntitySystems/SmokingSystem.Vape.cs b/Content.Server/Nutrition/EntitySystems/SmokingSystem.Vape.cs index 15661568f6..07fb24cd20 100644 --- a/Content.Server/Nutrition/EntitySystems/SmokingSystem.Vape.cs +++ b/Content.Server/Nutrition/EntitySystems/SmokingSystem.Vape.cs @@ -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 +} diff --git a/Resources/Locale/en-US/nutrition/components/vape-component.ftl b/Resources/Locale/en-US/nutrition/components/vape-component.ftl index 2d25e1a8de..d43bd5ebcc 100644 --- a/Resources/Locale/en-US/nutrition/components/vape-component.ftl +++ b/Resources/Locale/en-US/nutrition/components/vape-component.ftl @@ -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