Fix SharedPullable exception (#2431)

* Fix SharedPullable exception

* Smug in a bucket

* Logging

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2020-11-19 00:37:16 +11:00
committed by GitHub
parent 7677c3c03c
commit 9a10c672a6

View File

@@ -11,6 +11,7 @@ using Robust.Shared.GameObjects.ComponentDependencies;
using Robust.Shared.GameObjects.Components;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Log;
using Robust.Shared.Map;
using Robust.Shared.Physics;
using Robust.Shared.Serialization;
@@ -181,7 +182,13 @@ namespace Content.Shared.GameObjects.Components.Pulling
return;
}
Puller = Owner.EntityManager.GetEntity(state.Puller.Value);
if (!Owner.EntityManager.TryGetEntity(state.Puller.Value, out var entity))
{
Logger.Error($"Invalid entity {state.Puller.Value} for pulling");
return;
}
Puller = entity;
}
public override void HandleMessage(ComponentMessage message, IComponent? component)