]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Aghosts and other powerful beings no longer burn their hands on lights. (#23879)
authornikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com>
Wed, 10 Jan 2024 21:39:56 +0000 (23:39 +0200)
committerGitHub <noreply@github.com>
Wed, 10 Jan 2024 21:39:56 +0000 (16:39 -0500)
Make aghosts and other things that can't take burn damage not burn their
hand when changing lightbolbs

Content.Server/Light/EntitySystems/PoweredLightSystem.cs

index 6aea340e56590c1ef8017c36958ee437bf075ada..46b8506b3dc6923a394c86e82006e3abe4794b34 100644 (file)
@@ -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;
+                    }
                 }
             }