You can no longer move a PC entity unless it has a PlayerInputMover (#2987)
This commit is contained in:
committed by
GitHub
parent
7c48a5708e
commit
6a19dd9f02
@@ -14,6 +14,7 @@ using Content.Shared.Physics;
|
|||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Server.GameObjects.EntitySystems;
|
using Robust.Server.GameObjects.EntitySystems;
|
||||||
|
using Robust.Server.Interfaces.GameObjects;
|
||||||
using Robust.Server.Interfaces.Timing;
|
using Robust.Server.Interfaces.Timing;
|
||||||
using Robust.Shared.GameObjects.Components;
|
using Robust.Shared.GameObjects.Components;
|
||||||
using Robust.Shared.GameObjects.Components.Transform;
|
using Robust.Shared.GameObjects.Components.Transform;
|
||||||
@@ -45,8 +46,6 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
SubscribeLocalEvent<PlayerAttachSystemMessage>(PlayerAttached);
|
|
||||||
SubscribeLocalEvent<PlayerDetachedSystemMessage>(PlayerDetached);
|
SubscribeLocalEvent<PlayerDetachedSystemMessage>(PlayerDetached);
|
||||||
|
|
||||||
_audioSystem = EntitySystemManager.GetEntitySystem<AudioSystem>();
|
_audioSystem = EntitySystemManager.GetEntitySystem<AudioSystem>();
|
||||||
@@ -64,21 +63,8 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void PlayerAttached(PlayerAttachSystemMessage ev)
|
|
||||||
{
|
|
||||||
if (!ev.Entity.HasComponent<IMoverComponent>())
|
|
||||||
{
|
|
||||||
ev.Entity.AddComponent<PlayerInputMoverComponent>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void PlayerDetached(PlayerDetachedSystemMessage ev)
|
private void PlayerDetached(PlayerDetachedSystemMessage ev)
|
||||||
{
|
{
|
||||||
if (ev.Entity.HasComponent<PlayerInputMoverComponent>())
|
|
||||||
{
|
|
||||||
ev.Entity.RemoveComponent<PlayerInputMoverComponent>();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ev.Entity.TryGetComponent(out IPhysicsComponent? physics) &&
|
if (ev.Entity.TryGetComponent(out IPhysicsComponent? physics) &&
|
||||||
physics.TryGetController(out MoverController controller) &&
|
physics.TryGetController(out MoverController controller) &&
|
||||||
!ev.Entity.IsWeightless())
|
!ev.Entity.IsWeightless())
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ using Content.Server.Interfaces.GameTicking;
|
|||||||
using Content.Server.Mobs.Roles.Suspicion;
|
using Content.Server.Mobs.Roles.Suspicion;
|
||||||
using Content.Server.Players;
|
using Content.Server.Players;
|
||||||
using Content.Shared;
|
using Content.Shared;
|
||||||
using Content.Shared.GameObjects.Components.Damage;
|
|
||||||
using Content.Shared.GameObjects.Components.Mobs.State;
|
using Content.Shared.GameObjects.Components.Mobs.State;
|
||||||
using Robust.Server.GameObjects.EntitySystems;
|
using Robust.Server.GameObjects.EntitySystems;
|
||||||
using Robust.Server.Interfaces.Player;
|
using Robust.Server.Interfaces.Player;
|
||||||
@@ -22,8 +21,7 @@ using Timer = Robust.Shared.Timers.Timer;
|
|||||||
namespace Content.Server.GameTicking.GameRules
|
namespace Content.Server.GameTicking.GameRules
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Simple GameRule that will do a free-for-all death match.
|
/// Simple GameRule that will do a TTT-like gamemode with traitors.
|
||||||
/// Kill everybody else to win.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class RuleSuspicion : GameRule, IEntityEventSubscriber
|
public sealed class RuleSuspicion : GameRule, IEntityEventSubscriber
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
compatibility: Biological
|
compatibility: Biological
|
||||||
behaviors:
|
behaviors:
|
||||||
- !type:BrainBehavior {}
|
- !type:BrainBehavior {}
|
||||||
|
- type: Input
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
id: EyesHuman
|
id: EyesHuman
|
||||||
|
|||||||
@@ -61,6 +61,7 @@
|
|||||||
resistances: defaultResistances
|
resistances: defaultResistances
|
||||||
# criticalThreshold: 50
|
# criticalThreshold: 50
|
||||||
# deadThreshold: 120
|
# deadThreshold: 120
|
||||||
|
- type: Input
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
id: LeftArmHuman
|
id: LeftArmHuman
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
mask:
|
mask:
|
||||||
- GhostImpassable
|
- GhostImpassable
|
||||||
status: InAir
|
status: InAir
|
||||||
|
- type: PlayerInputMover
|
||||||
- type: Eye
|
- type: Eye
|
||||||
zoom: 0.5, 0.5
|
zoom: 0.5, 0.5
|
||||||
drawFov: false
|
drawFov: false
|
||||||
|
|||||||
@@ -125,6 +125,7 @@
|
|||||||
layer:
|
layer:
|
||||||
- Opaque
|
- Opaque
|
||||||
- MobImpassable
|
- MobImpassable
|
||||||
|
- type: PlayerInputMover
|
||||||
- type: AtmosExposed
|
- type: AtmosExposed
|
||||||
- type: Flammable
|
- type: Flammable
|
||||||
fireSpread: true
|
fireSpread: true
|
||||||
|
|||||||
Reference in New Issue
Block a user