Skip to content

Commit

Permalink
Sync ghost death time to client (new-frontiers-14#135)
Browse files Browse the repository at this point in the history
This fixes a bug with the respawn button where it did not show the
cooldown properly.
  • Loading branch information
dffdff2423 authored and Samsterious committed Apr 26, 2024
1 parent 8708014 commit 17f1765
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Content.Server/Ghost/GhostSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ private void OnGhostStartup(EntityUid uid, GhostComponent component, ComponentSt

var time = _gameTiming.CurTime;
component.TimeOfDeath = time;
Dirty(component);

Dirty(uid, component);
}

private void OnGhostShutdown(EntityUid uid, GhostComponent component, ComponentShutdown args)
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Ghost/GhostComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public sealed partial class GhostComponent : Component

// End actions

[ViewVariables(VVAccess.ReadWrite), DataField]
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
public TimeSpan TimeOfDeath = TimeSpan.Zero;

[DataField("booRadius"), ViewVariables(VVAccess.ReadWrite)]
Expand Down
1 change: 1 addition & 0 deletions Content.Shared/Ghost/SharedGhostSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public void SetTimeOfDeath(EntityUid uid, TimeSpan value, GhostComponent? compon
return;

component.TimeOfDeath = value;
Dirty(uid, component);
}

public void SetCanReturnToBody(EntityUid uid, bool value, GhostComponent? component = null)
Expand Down

0 comments on commit 17f1765

Please sign in to comment.