Revert "Explosion refactor TEST MERG (#6995)" (#7005)

This commit is contained in:
Leon Friedrich
2022-03-06 06:02:34 +13:00
committed by GitHub
parent cd1902cdf2
commit c95516e5b2
71 changed files with 766 additions and 3964 deletions

View File

@@ -1,10 +1,10 @@
using Content.Server.Chat.Managers;
using Content.Server.Construction.Components;
using Content.Server.Coordinates.Helpers;
using Content.Server.Explosion.EntitySystems;
using Content.Server.Popups;
using Content.Server.UserInterface;
using Content.Shared.Audio;
using Content.Shared.Body.Components;
using Content.Shared.Containers.ItemSlots;
using Content.Shared.Nuke;
using Content.Shared.Sound;
@@ -19,7 +19,7 @@ namespace Content.Server.Nuke
[Dependency] private readonly NukeCodeSystem _codes = default!;
[Dependency] private readonly ItemSlotsSystem _itemSlots = default!;
[Dependency] private readonly PopupSystem _popups = default!;
[Dependency] private readonly ExplosionSystem _explosions = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly IChatManager _chat = default!;
public override void Initialize()
@@ -397,16 +397,19 @@ namespace Content.Server.Nuke
if (!Resolve(uid, ref component, ref transform))
return;
if (component.Exploded)
return;
// gib anyone in a blast radius
// its lame, but will work for now
var pos = transform.Coordinates;
var ents = _lookup.GetEntitiesInRange(pos, component.BlastRadius);
foreach (var ent in ents)
{
var entUid = ent;
if (!EntityManager.EntityExists(entUid))
continue;
component.Exploded = true;
_explosions.QueueExplosion(uid,
component.ExplosionType,
component.TotalIntensity,
component.IntensitySlope,
component.MaxIntensity);
if (EntityManager.TryGetComponent(entUid, out SharedBodyComponent? body))
body.Gib();
}
EntityManager.DeleteEntity(uid);
}