Fix debug assert when using Control Entity verb on inanimate objects (#42525)
fix Control Entity assert
This commit is contained in:
parent
7f640dd56d
commit
cd522c8670
|
|
@ -20,6 +20,9 @@ using Content.Shared.Whitelist;
|
|||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
|
|
@ -37,6 +40,7 @@ public abstract partial class SharedMindSystem : EntitySystem
|
|||
[Dependency] private readonly MetaDataSystem _metadata = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelist = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _container = default!;
|
||||
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
||||
|
||||
[ViewVariables]
|
||||
protected readonly Dictionary<NetUserId, EntityUid> UserMinds = new();
|
||||
|
|
@ -686,6 +690,11 @@ public abstract partial class SharedMindSystem : EntitySystem
|
|||
EnsureComp<MindContainerComponent>(uid);
|
||||
if (allowMovement)
|
||||
{
|
||||
EnsureComp<PhysicsComponent>(uid, out var physics);
|
||||
// A debug assert will trip if the entity's BodyType is still "Dynamic" when it gets InputMover
|
||||
_physics.SetBodyType(uid, BodyType.KinematicController);
|
||||
Dirty(uid, physics);
|
||||
|
||||
EnsureComp<InputMoverComponent>(uid);
|
||||
EnsureComp<MobMoverComponent>(uid);
|
||||
EnsureComp<MovementSpeedModifierComponent>(uid);
|
||||
|
|
|
|||
Loading…
Reference in New Issue