@@ -1,5 +1,5 @@
|
||||
using Content.Shared.Movement.Components;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
using Robust.Shared.Network;
|
||||
@@ -79,7 +79,7 @@ public sealed partial class ReplaySpectatorSystem
|
||||
|
||||
public void SetSpectatorPosition(SpectatorData data)
|
||||
{
|
||||
if (_player.LocalSession == null)
|
||||
if (_player.LocalPlayer == null)
|
||||
return;
|
||||
|
||||
if (data.Controller != null
|
||||
@@ -87,13 +87,13 @@ public sealed partial class ReplaySpectatorSystem
|
||||
&& Exists(session.AttachedEntity)
|
||||
&& Transform(session.AttachedEntity.Value).MapID != MapId.Nullspace)
|
||||
{
|
||||
_player.SetAttachedEntity(_player.LocalSession, session.AttachedEntity);
|
||||
_player.LocalPlayer.AttachEntity(session.AttachedEntity.Value, EntityManager, _client);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Exists(data.Entity) && Transform(data.Entity).MapID != MapId.Nullspace)
|
||||
{
|
||||
_player.SetAttachedEntity(_player.LocalSession, data.Entity);
|
||||
_player.LocalPlayer.AttachEntity(data.Entity, EntityManager, _client);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ public sealed partial class ReplaySpectatorSystem
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.Eye != null && TryComp(_player.LocalSession.AttachedEntity, out InputMoverComponent? newMover))
|
||||
if (data.Eye != null && TryComp(_player.LocalPlayer.ControlledEntity, out InputMoverComponent? newMover))
|
||||
{
|
||||
newMover.RelativeEntity = data.Eye.Value.Ent;
|
||||
newMover.TargetRelativeRotation = newMover.RelativeRotation = data.Eye.Value.Rot;
|
||||
@@ -177,7 +177,7 @@ public sealed partial class ReplaySpectatorSystem
|
||||
SetSpectatorPosition(default);
|
||||
}
|
||||
|
||||
private void OnDetached(EntityUid uid, ReplaySpectatorComponent component, LocalPlayerDetachedEvent args)
|
||||
private void OnDetached(EntityUid uid, ReplaySpectatorComponent component, PlayerDetachedEvent args)
|
||||
{
|
||||
if (IsClientSide(uid))
|
||||
QueueDel(uid);
|
||||
|
||||
Reference in New Issue
Block a user