Content update for NetEntities (#18935)
This commit is contained in:
@@ -55,7 +55,7 @@ public sealed partial class ReplaySpectatorSystem
|
||||
return;
|
||||
}
|
||||
|
||||
if (!player.IsClientSide() || !HasComp<ReplaySpectatorComponent>(player))
|
||||
if (!IsClientSide(player) || !HasComp<ReplaySpectatorComponent>(player))
|
||||
{
|
||||
// Player is trying to move -> behave like the ghost-on-move component.
|
||||
SpawnSpectatorGhost(new EntityCoordinates(player, default), true);
|
||||
@@ -113,12 +113,9 @@ public sealed partial class ReplaySpectatorSystem
|
||||
_dir = dir;
|
||||
}
|
||||
|
||||
public override bool HandleCmdMessage(ICommonSession? session, InputCmdMessage message)
|
||||
public override bool HandleCmdMessage(IEntityManager entManager, ICommonSession? session, IFullInputCmdMessage message)
|
||||
{
|
||||
if (message is not FullInputCmdMessage full)
|
||||
return false;
|
||||
|
||||
if (full.State == BoundKeyState.Down)
|
||||
if (message.State == BoundKeyState.Down)
|
||||
_sys.Direction |= _dir;
|
||||
else
|
||||
_sys.Direction &= ~_dir;
|
||||
|
||||
@@ -167,7 +167,7 @@ public sealed partial class ReplaySpectatorSystem
|
||||
|
||||
private void OnDetached(EntityUid uid, ReplaySpectatorComponent component, PlayerDetachedEvent args)
|
||||
{
|
||||
if (uid.IsClientSide())
|
||||
if (IsClientSide(uid))
|
||||
QueueDel(uid);
|
||||
else
|
||||
RemCompDeferred(uid, component);
|
||||
|
||||
@@ -51,7 +51,7 @@ public sealed partial class ReplaySpectatorSystem
|
||||
if (old == null)
|
||||
return;
|
||||
|
||||
if (old.Value.IsClientSide())
|
||||
if (IsClientSide(old.Value))
|
||||
Del(old.Value);
|
||||
else
|
||||
RemComp<ReplaySpectatorComponent>(old.Value);
|
||||
@@ -77,7 +77,7 @@ public sealed partial class ReplaySpectatorSystem
|
||||
|
||||
if (old != null)
|
||||
{
|
||||
if (old.Value.IsClientSide())
|
||||
if (IsClientSide(old.Value))
|
||||
QueueDel(old.Value);
|
||||
else
|
||||
RemComp<ReplaySpectatorComponent>(old.Value);
|
||||
@@ -100,12 +100,14 @@ public sealed partial class ReplaySpectatorSystem
|
||||
return;
|
||||
}
|
||||
|
||||
if (!EntityUid.TryParse(args[0], out var uid))
|
||||
if (!NetEntity.TryParse(args[0], out var netEntity))
|
||||
{
|
||||
shell.WriteError(Loc.GetString("cmd-parse-failure-uid", ("arg", args[0])));
|
||||
return;
|
||||
}
|
||||
|
||||
var uid = GetEntity(netEntity);
|
||||
|
||||
if (!Exists(uid))
|
||||
{
|
||||
shell.WriteError(Loc.GetString("cmd-parse-failure-entity-exist", ("arg", args[0])));
|
||||
@@ -120,7 +122,7 @@ public sealed partial class ReplaySpectatorSystem
|
||||
if (args.Length != 1)
|
||||
return CompletionResult.Empty;
|
||||
|
||||
return CompletionResult.FromHintOptions(CompletionHelper.EntityUids(args[0],
|
||||
return CompletionResult.FromHintOptions(CompletionHelper.NetEntities(args[0],
|
||||
EntityManager), Loc.GetString("cmd-replay-spectate-hint"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user