Skip to content

Commit

Permalink
fixResp (#767)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZoNeSRuS authored Feb 21, 2024
1 parent 1213d15 commit 1cf43da
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Content.Server/Ghost/GhostSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
using Robust.Shared.Physics.Systems;
using Robust.Shared.Player;
using Robust.Shared.Timing;
using Robust.Server.Console;
using Robust.Shared.Network;

namespace Content.Server.Ghost
{
Expand All @@ -43,7 +43,6 @@ public sealed class GhostSystem : SharedGhostSystem
[Dependency] private readonly GameTicker _ticker = default!;
[Dependency] private readonly TransformSystem _transformSystem = default!;
[Dependency] private readonly VisibilitySystem _visibilitySystem = default!;
[Dependency] private readonly IServerConsoleHost _host = default!;

public override void Initialize()
{
Expand Down Expand Up @@ -124,7 +123,15 @@ private void OnActionRespanw(EntityUid uid, GhostComponent component, RespawnAct
if (!TryComp<ActorComponent>(uid, out var actor))
return;

_host.ExecuteCommand(actor.PlayerSession, "respawn");
var playerMgr = IoCManager.Resolve<IPlayerManager>();
NetUserId userId;
userId = actor.PlayerSession.UserId;
if (!playerMgr.TryGetSessionById(userId, out var targetPlayer))
return;

_ticker.Respawn(targetPlayer);


}
//SS-220 end noDeath
private void OnRelayMoveInput(EntityUid uid, GhostOnMoveComponent component, ref MoveInputEvent args)
Expand Down

0 comments on commit 1cf43da

Please sign in to comment.