Meteor Fix (#5717)

This commit is contained in:
Leon Friedrich
2021-12-10 04:34:38 +13:00
committed by GitHub
parent cd1b5f44e8
commit 896f80831b
2 changed files with 7 additions and 7 deletions

View File

@@ -344,19 +344,19 @@ namespace Content.Server.Explosion.EntitySystems
// logging
var text = $"{epicenter} with range {devastationRange}/{heavyImpactRange}/{lightImpactRange}/{flashRange}";
if (entity == null)
if (entity == null || !entity.Value.IsValid())
{
_logSystem.Add(LogType.Explosion, LogImpact.High, $"Explosion spawned at {text}");
}
else if (user == null)
else if (user == null || !user.Value.IsValid())
{
_logSystem.Add(LogType.Explosion, LogImpact.High,
$"{entity.Value} exploded at {text}");
$"{ToPrettyString(entity.Value)} exploded at {text}");
}
else
{
_logSystem.Add(LogType.Explosion, LogImpact.High,
$"{user.Value} caused {entity.Value} to explode at {text}");
$"{ToPrettyString(user.Value)} caused {ToPrettyString(entity.Value)} to explode at {text}");
}
var maxRange = MathHelper.Max(devastationRange, heavyImpactRange, lightImpactRange, 0);