Files
WT-Offline/patches/gui/battle/pass-spawn-modifications-blk/patch.jsonc
T
N0VAN0M4LY 647eff35fe 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.
2026-12-04 23:56:13 +08:00

28 lines
1.1 KiB
JSON

// Send the vehicle's modifications and chosen backup source with each LocalMP spawn request.
// Why the client: the battle server would read the modifications from the profile; on a LocalMP host
// the native spawn receiver (wto_ws.dll local_mp_loadout.c) only gets what this request carries.
// Without it: every spawned vehicle is stock (no fire extinguisher, smoke, repair kit, upgrades).
{
"id": "battle/pass-spawn-modifications-blk",
"title": "Pass enabled modifications and extra-slot loadout on LocalMP spawn",
"features": [
"K-Spawn score and respawns"
],
"variants": [
{
"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"
},
{ "find": "find-backup-choice.nut", "replace": "replace-backup-choice.nut" },
{ "find": "find-confirm-spawn.nut", "replace": "replace-confirm-spawn.nut" },
{ "find": "find-used-item.nut", "replace": "replace-used-item.nut" }
]
}
]
}