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
This commit is contained in:
nikthechampiongr
2024-01-10 23:39:56 +02:00
committed by GitHub
parent 464f24d040
commit 7aee192d52

View 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)
{
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);
_audio.PlayEntity(light.BurnHandSound, Filter.Pvs(uid), uid, true);
args.Handled = true;
return;
args.Handled = true;
return;
}
}
}