mirror of
https://github.com/space-wizards/space-station-14.git
synced 2026-02-14 19:29:53 +01:00
Fix debug assert when using Control Entity verb on inanimate objects (#42525)
fix Control Entity assert
This commit is contained in:
@@ -19,6 +19,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;
|
||||
@@ -36,6 +39,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();
|
||||
@@ -670,6 +674,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);
|
||||
|
||||
Reference in New Issue
Block a user