Fix ContactInteractionEvent exceptions (#12314)
This commit is contained in:
@@ -1013,6 +1013,10 @@ namespace Content.Shared.Interaction
|
|||||||
if (uidB == null || args?.Handled == false)
|
if (uidB == null || args?.Handled == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Entities may no longer exist (banana was eaten, or human was exploded)?
|
||||||
|
if (!Exists(uidA) || !Exists(uidB))
|
||||||
|
return;
|
||||||
|
|
||||||
RaiseLocalEvent(uidA, new ContactInteractionEvent(uidB.Value));
|
RaiseLocalEvent(uidA, new ContactInteractionEvent(uidB.Value));
|
||||||
RaiseLocalEvent(uidB.Value, new ContactInteractionEvent(uidA));
|
RaiseLocalEvent(uidB.Value, new ContactInteractionEvent(uidA));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user