Files
WT-Offline/gui-patches/battle/append-extra-battle-slots/patch.json
T
N0VAN0M4LY b260d2899e chore(battle): snapshot the LocalMP rework baseline
Records the uncommitted battle-session work exactly as it was left
(local service matchmaking, settlement, chat, native LocalMP hooks,
battle gui/exe patches) so the following review and rework commits
show every correction as a diff against this state.

This commit is not reviewed and is known to be incomplete: in-game
testing reported wrong settlement rewards, single-country teams,
missing random/fixed supplement slots, misattributed hit messages and
other regressions. Do not merge this branch before the rework lands.
2026-11-28 03:15:47 +08:00

12 lines
2.1 KiB
JSON

{
"id": "battle/append-extra-battle-slots",
"title": "Append session killstreak aircraft and random-spawn vehicles to in-battle crew list",
"file": "scripts/slotbar/crewslist.nut",
"reason": "Dedicated servers append nuclear bombers, strike UCAVs, and RandomSpawnUnits filler slots to the battle crew list; appending activeBattle.extraBattleSlots when isInBattle is true exposes those slots to the respawn screen and slotbar.",
"features": ["J-本地对局", "K-战局任务加载"],
"edit": {
"find": " let res = crewInfo.filter(@(v) v.country == curCountry)\r\n if (res.len() == 1)\r\n return res.map(\r\n @(countryInfo) countryInfo.__merge({\r\n crews = countryInfo.crews.map(@(crew) crew.__merge({idCountry = 0}))\r\n })\r\n )",
"replace": " let appendWtoExtraBattleCrews = function(baseCrews) {\r\n let { ndbTryRead } = require(\"nestdb\")\r\n let wtoBattle = ndbTryRead([\"wto\", \"activeBattle\"])\r\n let extraSlots = wtoBattle?.extraBattleSlots\r\n if (extraSlots == null || extraSlots.len() == 0)\r\n return baseCrews\r\n if ((wtoBattle?.country ?? \"\") != \"\" && wtoBattle.country != curCountry)\r\n return baseCrews\r\n let merged = [].extend(baseCrews)\r\n foreach (idx, slot in extraSlots) {\r\n if (merged.len() >= 32)\r\n break\r\n let unitName = slot?.unitName ?? \"\"\r\n if (unitName == \"\")\r\n continue\r\n merged.append({\r\n id = -1 - idx\r\n idCountry = 0\r\n idInCountry = merged.len()\r\n country = curCountry\r\n aircraft = unitName\r\n isEmpty = 0\r\n trainedSpec = { [unitName] = 2 }\r\n trained = [unitName]\r\n skillPoints = 0\r\n lockedTillSec = 0\r\n isLocked = 0\r\n })\r\n }\r\n return merged\r\n }\r\n let res = crewInfo.filter(@(v) v.country == curCountry)\r\n if (res.len() == 1)\r\n return res.map(\r\n @(countryInfo) countryInfo.__merge({\r\n crews = appendWtoExtraBattleCrews(\r\n countryInfo.crews.map(@(crew) crew.__merge({idCountry = 0}))\r\n )\r\n })\r\n )"
}
}