Fix after interact target GetComponent exception
This commit is contained in:
@@ -409,6 +409,9 @@ namespace Content.Shared.Interaction
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public async Task<bool> InteractDoAfter(EntityUid user, EntityUid used, EntityUid? target, EntityCoordinates clickLocation, bool canReach)
|
public async Task<bool> InteractDoAfter(EntityUid user, EntityUid used, EntityUid? target, EntityCoordinates clickLocation, bool canReach)
|
||||||
{
|
{
|
||||||
|
if (target is {Valid: false})
|
||||||
|
target = null;
|
||||||
|
|
||||||
var afterInteractEvent = new AfterInteractEvent(user, used, target, clickLocation, canReach);
|
var afterInteractEvent = new AfterInteractEvent(user, used, target, clickLocation, canReach);
|
||||||
RaiseLocalEvent(used, afterInteractEvent, false);
|
RaiseLocalEvent(used, afterInteractEvent, false);
|
||||||
if (afterInteractEvent.Handled)
|
if (afterInteractEvent.Handled)
|
||||||
|
|||||||
Reference in New Issue
Block a user