From ee41d309f5ae10c9eafce750499d881669959e6a Mon Sep 17 00:00:00 2001
From: toaster <rollerorbital@gmail.com>
Date: Sat, 6 Apr 2024 20:54:19 +0100
Subject: [PATCH] P_Ticker: Fix tracking Attacking modes

- SPB: The standard set-up has ATTACKING_TIME in addition to ATTACKING_SPB, so the _TIME check first prevented it from ever being ticked
- SPB: Check for encoremode instead of ATTACKING_SPB, to cover Versus SPB as well
- All Attacking modes: Check for != ATTACKING_NONE just in case we add other potential modeattacking configurations later
---
 src/p_tick.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/src/p_tick.c b/src/p_tick.c
index 961375410c..8d3187580f 100644
--- a/src/p_tick.c
+++ b/src/p_tick.c
@@ -1005,20 +1005,23 @@ void P_Ticker(boolean run)
 				}
 
 				// Attacking mode playtime
-				if ((modeattacking & ATTACKING_TIME) != 0)
+				if (modeattacking != ATTACKING_NONE)
 				{
-					gamedata->timeattackingtotaltime++;
-					if (mapheader)
+					if (encoremode) // ((modeattacking & ATTACKING_SPB) != 0)
 					{
-						mapheader->records.timeattacktimeplayed++;
+						gamedata->spbattackingtotaltime++;
+						if (mapheader)
+						{
+							mapheader->records.spbattacktimeplayed++;
+						}
 					}
-				}
-				else if ((modeattacking & ATTACKING_SPB) != 0)
-				{
-					gamedata->spbattackingtotaltime++;
-					if (mapheader)
+					else
 					{
-						mapheader->records.spbattacktimeplayed++;
+						gamedata->timeattackingtotaltime++;
+						if (mapheader)
+						{
+							mapheader->records.timeattacktimeplayed++;
+						}
 					}
 				}
 
-- 
GitLab