Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transfer all unbuilt units on death (FAForever#6363)
## Description of the proposed changes <!-- A clear and concise description (or visuals) of what the changes imply. --> <!-- If it closes an issue, make sure to link the issue by using "(Closes/Fixes/Resolves) #(Issue Number)" in your pull request. --> Resolves FAForever#6361. - Changes the categories for structure transfer from T4s and T3 Arty to all units. - Adjusts the stats of the wreckage created when a unit rebuild fails so that the wreckage has the full mass of the failed unit. ## Testing done on the proposed changes <!-- List all relevant testing that you've done to confirm the changes work. --> Spawn a paragon and some t3 engineers (they dont shoot) then build any unfinished structure or unit from a factory and run the console command to transfer the units to the opposite of the current focused army: ```lua SimLua local units = ArmyBrains[GetFocusArmy()]:GetListOfUnits(categories.ALLUNITS) local SimUtils = import('/lua/SimUtils.lua') local target = GetFocusArmy() == 2 and {1} or {2} ForkThread(SimUtils.TransferUnfinishedUnitsAfterDeath, units, target, false) ``` All structures get shared properly, and unbuilt units in factories turn into wrecks of the same partial cost as the unbuilt unit. Didn't test performance, I'm not sure how to. ## Checklist - [x] Changes are annotated, including comments where useful - [x] Changes are documented in the changelog for the next game version
- Loading branch information