Skip to content

Commit

Permalink
Add error logging for Auto ACO procedure. (#2450)
Browse files Browse the repository at this point in the history
* Add error logging for Auto ACO procedure.

* type
  • Loading branch information
ewokswagger authored Dec 18, 2024
1 parent 9146ee3 commit 94b2542
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public sealed partial class CaptainStateComponent : Component
/// Assume no captain unless specified
/// </remarks>
[DataField]
public bool HasCaptain;
public bool HasCaptain = false;

/// <summary>
/// The localization ID used for announcing the cancellation of ACO requests
Expand All @@ -42,13 +42,13 @@ public sealed partial class CaptainStateComponent : Component
/// Set after ACO has been requested to avoid duplicate calls
/// </summary>
[DataField]
public bool IsACORequestActive;
public bool IsACORequestActive = false;

/// <summary>
/// Used to denote that AA has been brought into the round either from captain or safe.
/// </summary>
[DataField]
public bool IsAAInPlay;
public bool IsAAInPlay = false;

/// <summary>
/// The localization ID for announcing that AA has been unlocked for ACO
Expand Down
6 changes: 6 additions & 0 deletions Content.Server/DeltaV/Station/Systems/CaptainStateSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ public override void Update(float frameTime)
var query = EntityQueryEnumerator<CaptainStateComponent>();
while (query.MoveNext(out var station, out var captainState))
{
if (currentTime < _acoDelay && captainState.IsACORequestActive == true) // Avoid timing issues. No need to run before _acoDelay is reached anyways.
{
Log.Error($"{captainState} IsACORequestActive true before ACO request time.");
captainState.IsACORequestActive = false;
}

if (captainState.HasCaptain)
HandleHasCaptain(station, captainState);
else
Expand Down

0 comments on commit 94b2542

Please sign in to comment.