Fix resolve error when FollowedComponent is not found in StopFollowingEntity (#7276)

This commit is contained in:
DrSmugleaf
2022-03-25 22:10:37 +01:00
committed by GitHub
parent 0b40f14258
commit 648ffbf673

View File

@@ -1,12 +1,8 @@
using Content.Shared.Database; using Content.Shared.Database;
using Content.Shared.Follower.Components;
using Content.Shared.Ghost; using Content.Shared.Ghost;
using Content.Shared.Movement.EntitySystems; using Content.Shared.Movement.EntitySystems;
using Content.Shared.Verbs; using Content.Shared.Verbs;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Content.Shared.Follower.Components;
using Robust.Shared.Maths;
using Robust.Shared.Serialization;
namespace Content.Shared.Follower; namespace Content.Shared.Follower;
@@ -92,7 +88,7 @@ public sealed class FollowerSystem : EntitySystem
public void StopFollowingEntity(EntityUid uid, EntityUid target, public void StopFollowingEntity(EntityUid uid, EntityUid target,
FollowedComponent? followed=null) FollowedComponent? followed=null)
{ {
if (!Resolve(target, ref followed)) if (!Resolve(target, ref followed, false))
return; return;
if (!HasComp<FollowerComponent>(uid)) if (!HasComp<FollowerComponent>(uid))