0ad/source/simulation2/system
vyordan 71be79791f
Some checks failed
checkrefs / lfscheck (push) Has been cancelled
checkrefs / checkrefs (push) Has been cancelled
lint / cppcheck (push) Has been cancelled
lint / copyright (push) Has been cancelled
lint / jenkinsfiles (push) Has been cancelled
pre-commit / build (push) Has been cancelled
Use turn_id_t (int32_t) for turn-count across simulation, network and replay
CSimulation2 used , CSimulation2Impl mixed /, and
CTurnManager used  for the same turn-count concept, forcing a
static_cast<int64_t> at the one place these types already met
(rejoin-test comparison).

Add  (alias for std::int32_t) in SimulationCommand.h and use
it consistently for every turn counter in CSimulation2/Impl,
CTurnManager and its subclasses (CLocalTurnManager,
CReplayTurnManager), CNetServerTurnManager/CNetClientTurnManager, and
the network wire format (m_Turn in CEndCommandBatchMessage,
CSimulationMessage, CSyncCheckMessage, CSyncErrorMessage, and
m_CurrentTurn in CLoadedGameMessage).

Turn *duration* fields (m_TurnLength, m_CommandDelay,
DEFAULT_TURN_LENGTH, COMMAND_DELAY_SP/MP, SetTurnLength,
GetSavedTurnLength return type) are left as u32 — they're milliseconds,
not a counter, and out of scope here.

Remaining turn_id_t vs size_t comparisons use std::cmp_equal or
explicit casts, matching the existing pattern in Simulation2.cpp.

Fixes #8718
2026-07-31 10:34:20 +02:00
..
CmpPtr.cpp Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
CmpPtr.h Fix includes in source/ps 2025-08-05 07:21:22 +02:00
Component.h Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
ComponentManager.cpp Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
ComponentManager.h Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
ComponentManagerSerialization.cpp Fix includes in source/simulation2 2025-08-07 08:38:40 +02:00
Components.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
ComponentTest.h Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
DebugOptions.h Start the serializationtest at a specivic turn 2026-05-10 14:18:48 +02:00
DynamicSubscription.cpp Fix includes in source/simulation2 2025-08-07 08:38:40 +02:00
DynamicSubscription.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
Entity.h Fix includes in source/ps 2025-08-05 07:21:22 +02:00
EntityMap.h Fix EntityMap::iterator 2025-11-11 21:35:01 +01:00
IComponent.cpp Remove UNUSED 2025-06-26 17:25:05 +02:00
IComponent.h Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
Interface.h Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
InterfaceScripted.h Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
LocalTurnManager.cpp Use turn_id_t (int32_t) for turn-count across simulation, network and replay 2026-07-31 10:34:20 +02:00
LocalTurnManager.h Use turn_id_t (int32_t) for turn-count across simulation, network and replay 2026-07-31 10:34:20 +02:00
Message.h Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
ParamNode.cpp Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
ParamNode.h Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
ReplayTurnManager.cpp Use turn_id_t (int32_t) for turn-count across simulation, network and replay 2026-07-31 10:34:20 +02:00
ReplayTurnManager.h Use turn_id_t (int32_t) for turn-count across simulation, network and replay 2026-07-31 10:34:20 +02:00
SimContext.cpp Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
SimContext.h Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
TurnManager.cpp Use turn_id_t (int32_t) for turn-count across simulation, network and replay 2026-07-31 10:34:20 +02:00
TurnManager.h Use turn_id_t (int32_t) for turn-count across simulation, network and replay 2026-07-31 10:34:20 +02:00