0ad/source/simulation2
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
..
components Add a test for ExploreCircle 2026-07-29 18:02:37 +02:00
docs Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
helpers Use turn_id_t (int32_t) for turn-count across simulation, network and replay 2026-07-31 10:34:20 +02:00
scripting Remove global g_xres and x_yres 2026-07-08 11:35:46 +02:00
serialization Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
system Use turn_id_t (int32_t) for turn-count across simulation, network and replay 2026-07-31 10:34:20 +02:00
tests Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
MessageTypes.h Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
Simulation2.cpp Use turn_id_t (int32_t) for turn-count across simulation, network and replay 2026-07-31 10:34:20 +02:00
Simulation2.h Use turn_id_t (int32_t) for turn-count across simulation, network and replay 2026-07-31 10:34:20 +02:00
TypeList.h Store whether a player is activ in C++ 2025-01-05 19:57:12 +01:00