Make gibbing drop items again (#21047)

LGTM, Just a warning that this will probably get overriden when medical refactor gets merged since it refactors gibbing.
This commit is contained in:
Doru991
2023-10-19 00:15:17 +03:00
committed by GitHub
parent 9c25db8b13
commit b419dbb3eb
3 changed files with 20 additions and 6 deletions

View File

@@ -111,7 +111,7 @@ public sealed class BodySystem : SharedBodySystem
_humanoidSystem.SetLayersVisibility(bodyUid, layers, false, true, humanoid);
}
public override HashSet<EntityUid> GibBody(EntityUid bodyId, bool gibOrgans = false, BodyComponent? body = null, bool deleteItems = false)
public override HashSet<EntityUid> GibBody(EntityUid bodyId, bool gibOrgans = false, BodyComponent? body = null, bool deleteItems = false, bool deleteBrain = false)
{
if (!Resolve(bodyId, ref body, false))
return new HashSet<EntityUid>();
@@ -123,7 +123,7 @@ public sealed class BodySystem : SharedBodySystem
if (xform.MapUid == null)
return new HashSet<EntityUid>();
var gibs = base.GibBody(bodyId, gibOrgans, body, deleteItems);
var gibs = base.GibBody(bodyId, gibOrgans, body, deleteItems, deleteBrain);
var coordinates = xform.Coordinates;
var filter = Filter.Pvs(bodyId, entityManager: EntityManager);
@@ -135,7 +135,10 @@ public sealed class BodySystem : SharedBodySystem
{
if (deleteItems)
{
QueueDel(entity);
if (!HasComp<BrainComponent>(entity) || deleteBrain)
{
QueueDel(entity);
}
}
else
{