function getForcedUnitWeapon(unit) { // WTOffline: the extra vehicles the local server added to a LocalMP lineup carry their forced // weapon (nuclear carrier, RandomSpawnUnits forceWeapon); online the battle server sends it. foreach (wtoSlot in (require("nestdb").ndbTryRead(["wto", "activeBattle"])?.extraBattleSlots ?? [])) if (wtoSlot?.unitName == unit.name && (wtoSlot?.forceWeapon ?? "") != "") return wtoSlot.forceWeapon let groupName = this.getRandomUnitsGroupName(unit.name) if (groupName == null) return this.missionParams?.editSlotbar[unit.shopCountry][unit.name]["forceWeapon"] return getRandomUnitsForceWeapon(getEventEconomicName(getRoomEvent()), unit.name) }