Remove IMobStateComponent (#5220)

This commit is contained in:
Javier Guardia Fernández
2021-11-08 15:11:58 +01:00
committed by GitHub
parent 4236551d86
commit f5b11d6af8
35 changed files with 84 additions and 144 deletions

View File

@@ -1,6 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Shared.MobState;
using Content.Shared.MobState.Components;
using Content.Shared.Movement.Components;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
@@ -54,7 +53,7 @@ namespace Content.Shared.Movement.EntitySystems
// For stuff like "Moving out of locker" or the likes
if (owner.IsInContainer() &&
(!owner.TryGetComponent(out IMobStateComponent? mobState) ||
(!owner.TryGetComponent(out MobStateComponent? mobState) ||
mobState.IsAlive()))
{
var relayMoveEvent = new RelayMovementEntityEvent(owner);

View File

@@ -2,7 +2,7 @@ using System.Collections.Generic;
using Content.Shared.ActionBlocker;
using Content.Shared.CCVar;
using Content.Shared.Friction;
using Content.Shared.MobState;
using Content.Shared.MobState.Components;
using Content.Shared.Movement.Components;
using Content.Shared.Pulling.Components;
using Robust.Shared.Configuration;
@@ -160,7 +160,7 @@ namespace Content.Shared.Movement
protected bool UseMobMovement(PhysicsComponent body)
{
return body.BodyStatus == BodyStatus.OnGround &&
body.Owner.HasComponent<IMobStateComponent>() &&
body.Owner.HasComponent<MobStateComponent>() &&
// If we're being pulled then don't mess with our velocity.
(!body.Owner.TryGetComponent(out SharedPullableComponent? pullable) || !pullable.BeingPulled) &&
_blocker.CanMove(body.Owner);