refactor: extract guidToUnitId/getQuestTitle helpers and misc cleanup

- Extract guidToUnitId(), getQuestTitle(), findQuestLogEntry() helpers
  to replace 14 duplicated GUID-to-unitId patterns and 7 quest log
  search patterns in game_handler.cpp
- Remove duplicate #include in renderer.cpp
- Remove commented-out model cleanup code in terrain_manager.cpp
- Replace C-style casts with static_cast in auth and transport code
This commit is contained in:
Kelsi 2026-03-25 11:25:44 -07:00
parent 087e42d7a1
commit 98b9e502c5
7 changed files with 57 additions and 124 deletions

View file

@ -264,11 +264,11 @@ void TransportManager::updateTransportMovement(ActiveTransport& transport, float
if (transport.hasServerClock) {
// Predict server time using clock offset (works for both client and server-driven modes)
int64_t serverTimeMs = (int64_t)nowMs + transport.serverClockOffsetMs;
int64_t mod = (int64_t)path.durationMs;
int64_t serverTimeMs = static_cast<int64_t>(nowMs) + transport.serverClockOffsetMs;
int64_t mod = static_cast<int64_t>(path.durationMs);
int64_t wrapped = serverTimeMs % mod;
if (wrapped < 0) wrapped += mod;
pathTimeMs = (uint32_t)wrapped;
pathTimeMs = static_cast<uint32_t>(wrapped);
} else if (transport.useClientAnimation) {
// Pure local clock (no server sync yet, client-driven)
uint32_t dtMs = static_cast<uint32_t>(deltaTime * 1000.0f);