Fix units not rebuilding on army transfer #6106
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: efdfc5e in a different way (we at least divide by buildrate in
GetReclaimCosts
andGiveNukeSiloBlocks
).Checklist