Organ fixes (#20488)

This commit is contained in:
metalgearsloth
2023-09-30 01:01:47 +10:00
committed by GitHub
parent 4313a6ee66
commit 290c2fd502
5 changed files with 24 additions and 49 deletions

View File

@@ -12,7 +12,7 @@ public partial class SharedBodySystem
private void AddOrgan(EntityUid uid, EntityUid bodyUid, EntityUid parentPartUid, OrganComponent component)
{
component.Body = bodyUid;
RaiseLocalEvent(uid, new AddedToPartEvent(bodyUid));
RaiseLocalEvent(uid, new AddedToPartEvent(parentPartUid));
if (component.Body != null)
RaiseLocalEvent(uid, new AddedToPartInBodyEvent(component.Body.Value, parentPartUid));
@@ -20,12 +20,14 @@ public partial class SharedBodySystem
Dirty(uid, component);
}
private void RemoveOrgan(EntityUid uid, EntityUid bodyUid, EntityUid parentPartUid, OrganComponent component)
private void RemoveOrgan(EntityUid uid, EntityUid parentPartUid, OrganComponent component)
{
RaiseLocalEvent(uid, new RemovedFromPartEvent(bodyUid));
RaiseLocalEvent(uid, new RemovedFromPartEvent(parentPartUid));
if (component.Body != null)
{
RaiseLocalEvent(uid, new RemovedFromPartInBodyEvent(component.Body.Value, parentPartUid));
}
component.Body = null;
Dirty(uid, component);