Fixes units not being rebuilt after being transferred.
Testing done on the proposed changes
Spawn a bunch of RAS presets, start building a T4 unit. Then run this console command to transfer the unbuilt T4 to yourself:
SimLua
local tu = import('/lua/SimUtils.lua').TransferUnfinishedUnitsAfterDeath
local b = ArmyBrains[GetFocusArmy()]
local units = b:GetListOfUnits(categories.EXPERIMENTAL)
ForkThread(tu, units, {b:GetArmyIndex()})
It should return to you at the same HP/progress you partially built it at.
Additional context
Caused by a change to Unit:GetBuildRate (lua, not engine function) in #5932 unrelated to the reclaim costs. Instead of returning 0.0001 for 0 buildrate, it returned 0 which did not allow the rebuilder unit (zxa0001) to build.
Description of the proposed changes
Fixes units not being rebuilt after being transferred.
Testing done on the proposed changes
Spawn a bunch of RAS presets, start building a T4 unit. Then run this console command to transfer the unbuilt T4 to yourself:
It should return to you at the same HP/progress you partially built it at.
Additional context
Caused by a change to
Unit:GetBuildRate
(lua, not engine function) in #5932 unrelated to the reclaim costs. Instead of returning 0.0001 for 0 buildrate, it returned 0 which did not allow the rebuilder unit (zxa0001
) to build.This means that an alternative fix is to give the rebuilder 1 buildrate, and fixing this: https://github.com/FAForever/fa/commit/efdfc5e5a1ee68d45246df075fa864f6fdf558bd in a different way (we at least divide by buildrate in
GetReclaimCosts
andGiveNukeSiloBlocks
).Checklist