From 7aee192d528222b3d5d2a479dd2baec626f0a040 Mon Sep 17 00:00:00 2001 From: nikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com> Date: Wed, 10 Jan 2024 23:39:56 +0200 Subject: [PATCH] Aghosts and other powerful beings no longer burn their hands on lights. (#23879) Make aghosts and other things that can't take burn damage not burn their hand when changing lightbolbs --- .../Light/EntitySystems/PoweredLightSystem.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Content.Server/Light/EntitySystems/PoweredLightSystem.cs b/Content.Server/Light/EntitySystems/PoweredLightSystem.cs index 6aea340e56..46b8506b3d 100644 --- a/Content.Server/Light/EntitySystems/PoweredLightSystem.cs +++ b/Content.Server/Light/EntitySystems/PoweredLightSystem.cs @@ -127,19 +127,20 @@ namespace Content.Server.Light.EntitySystems var burnedHand = light.CurrentLit && res < lightBulb.BurningTemperature; if (burnedHand) { - // apply damage to users hands and show message with sound - var burnMsg = Loc.GetString("powered-light-component-burn-hand"); - _popupSystem.PopupEntity(burnMsg, uid, userUid); - var damage = _damageableSystem.TryChangeDamage(userUid, light.Damage, origin: userUid); + // If damage is null then the entity could not take heat damage so they did not get burned. if (damage != null) - _adminLogger.Add(LogType.Damaged, $"{ToPrettyString(args.User):user} burned their hand on {ToPrettyString(args.Target):target} and received {damage.Total:damage} damage"); + { - _audio.PlayEntity(light.BurnHandSound, Filter.Pvs(uid), uid, true); + var burnMsg = Loc.GetString("powered-light-component-burn-hand"); + _popupSystem.PopupEntity(burnMsg, uid, userUid); + _adminLogger.Add(LogType.Damaged, $"{ToPrettyString(args.User):user} burned their hand on {ToPrettyString(args.Target):target} and received {damage.Total:damage} damage"); + _audio.PlayEntity(light.BurnHandSound, Filter.Pvs(uid), uid, true); - args.Handled = true; - return; + args.Handled = true; + return; + } } } -- 2.51.2