Meteor Fix (#5717)
This commit is contained in:
@@ -124,9 +124,9 @@ namespace Content.Server.Administration
|
|||||||
verb.Category = VerbCategory.Debug;
|
verb.Category = VerbCategory.Debug;
|
||||||
verb.Act = () =>
|
verb.Act = () =>
|
||||||
{
|
{
|
||||||
var coords = EntityManager.GetComponent<TransformComponent>(args.Target).Coordinates;
|
var coords = Transform(args.Target).Coordinates;
|
||||||
Timer.Spawn(_gameTiming.TickPeriod, () => _explosions.SpawnExplosion(coords, 0, 1, 2, 1, args.Target), CancellationToken.None);
|
Timer.Spawn(_gameTiming.TickPeriod, () => _explosions.SpawnExplosion(coords, 0, 1, 2, 1), CancellationToken.None);
|
||||||
if (EntityManager.TryGetComponent(args.Target, out SharedBodyComponent? body))
|
if (TryComp(args.Target, out SharedBodyComponent? body))
|
||||||
{
|
{
|
||||||
body.Gib();
|
body.Gib();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -344,19 +344,19 @@ namespace Content.Server.Explosion.EntitySystems
|
|||||||
|
|
||||||
// logging
|
// logging
|
||||||
var text = $"{epicenter} with range {devastationRange}/{heavyImpactRange}/{lightImpactRange}/{flashRange}";
|
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}");
|
_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,
|
_logSystem.Add(LogType.Explosion, LogImpact.High,
|
||||||
$"{entity.Value} exploded at {text}");
|
$"{ToPrettyString(entity.Value)} exploded at {text}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_logSystem.Add(LogType.Explosion, LogImpact.High,
|
_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);
|
var maxRange = MathHelper.Max(devastationRange, heavyImpactRange, lightImpactRange, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user