fix(battle): unblock LocalMP backup respawns and normalize unit names

Store the selected LocalMP backup token in a separate wtoLastBackup handler field instead of mutating requestData.wtoBackup. Mutating requestData caused respawn.nut checkReady() u.isEqual(lastRequestData, getSelectedRequestData()) to always evaluate false for backup spawns, preventing doRespawnPlayer() from ever running.

Also fix downstream ground and naval backup accounting where native UnitInfo::name carries folder prefixes (e.g. tankModels/cn_type_59) that mismatched bare unit IDs in session.spareSlots, by stripping path prefixes in local_mp_awards.c, record-local-battle-awards, battle-spares.ts, and battle-queue-requests.ts. Update hook_is_slot_ready_at_host to check USED_SPARES_MASK rather than BROKEN_SLOTS_MASK so unrepaired slots remain eligible for a backup spawn.

Verified root and launcher typecheck, 2.61.0.37 and 2.61.0.58 check-gui (50 patches / 37 .nut), check-patches (14/14), checkPatchSet, battle-spares runnable check, and MSVC temp build of wto_ws.dll (0 warnings in project C sources). Pending regular-terminal build of build/native/wto_ws.dll and in-game acceptance.
This commit is contained in:
N0VAN0M4LY committed 2026-12-04 23:56:13 +08:00
1 parent c3cf4e3707
commit 647eff35fe
11 files changed
+49 -16

No files matched your search

@@ -13,6 +13,7 @@
"written_for": "2.61.0.37",
"file": "scripts/respawn/respawn.nut",
"edits": [
{ "find": "find-backup-field.nut", "replace": "replace-backup-field.nut" },
{
"find": "find.nut",
"replace": "replace.nut"