From 94b2542165554db48bc78937d8cedde02d2427ec Mon Sep 17 00:00:00 2001
From: SolStar <44028047+ewokswagger@users.noreply.github.com>
Date: Wed, 18 Dec 2024 02:25:22 -0500
Subject: [PATCH] Add error logging for Auto ACO procedure. (#2450)
* Add error logging for Auto ACO procedure.
* type
---
.../DeltaV/Station/Components/CaptainStateComponent.cs | 6 +++---
Content.Server/DeltaV/Station/Systems/CaptainStateSystem.cs | 6 ++++++
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/Content.Server/DeltaV/Station/Components/CaptainStateComponent.cs b/Content.Server/DeltaV/Station/Components/CaptainStateComponent.cs
index 96d7c441071..d432e9ea6d0 100644
--- a/Content.Server/DeltaV/Station/Components/CaptainStateComponent.cs
+++ b/Content.Server/DeltaV/Station/Components/CaptainStateComponent.cs
@@ -18,7 +18,7 @@ public sealed partial class CaptainStateComponent : Component
/// Assume no captain unless specified
///
[DataField]
- public bool HasCaptain;
+ public bool HasCaptain = false;
///
/// The localization ID used for announcing the cancellation of ACO requests
@@ -42,13 +42,13 @@ public sealed partial class CaptainStateComponent : Component
/// Set after ACO has been requested to avoid duplicate calls
///
[DataField]
- public bool IsACORequestActive;
+ public bool IsACORequestActive = false;
///
/// Used to denote that AA has been brought into the round either from captain or safe.
///
[DataField]
- public bool IsAAInPlay;
+ public bool IsAAInPlay = false;
///
/// The localization ID for announcing that AA has been unlocked for ACO
diff --git a/Content.Server/DeltaV/Station/Systems/CaptainStateSystem.cs b/Content.Server/DeltaV/Station/Systems/CaptainStateSystem.cs
index 38475da89be..c790b22f782 100644
--- a/Content.Server/DeltaV/Station/Systems/CaptainStateSystem.cs
+++ b/Content.Server/DeltaV/Station/Systems/CaptainStateSystem.cs
@@ -46,6 +46,12 @@ public override void Update(float frameTime)
var query = EntityQueryEnumerator();
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