Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix units not rebuilding on army transfer #6106

Merged
merged 3 commits into from Apr 22, 2024

Conversation

lL1l1
Copy link
Contributor

@lL1l1 lL1l1 commented Apr 22, 2024

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:

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.

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 and GiveNukeSiloBlocks).

Checklist

  • Changes are annotated, including comments where useful
  • Changes are documented in the changelog for the next game version

@lL1l1 lL1l1 requested a review from Garanas April 22, 2024 02:39
@Garanas
Copy link
Member

Garanas commented Apr 22, 2024

Great find!

edit: also a very interesting approach to testing it. How did you come up with that?

@Garanas Garanas merged commit 23ebe48 into FAForever:deploy/fafdevelop Apr 22, 2024
clyfordv added a commit to clyfordv/fa that referenced this pull request Apr 23, 2024
commit ceb09ce
Author: Josh <row.josh02@gmail.com>
Date:   Tue Apr 23 09:35:48 2024 +0100

    Balance : TML Hp Reduction & Adds Death Weapon (FAForever#6104)

    Co-authored-by: lL1l1 <82986251+lL1l1@users.noreply.github.com>

commit 23ebe48
Author: lL1l1 <82986251+lL1l1@users.noreply.github.com>
Date:   Mon Apr 22 12:06:13 2024 -0700

    Fix units not rebuilding on army transfer (FAForever#6106)

commit 5f7b2a9
Author: clyf <clyfordv@gmail.com>
Date:   Mon Apr 22 04:15:20 2024 -0400

    Simplify and robustify transport cargo killing and veterancy (FAForever#6091)

    Co-authored-by: lL1l1 <82986251+lL1l1@users.noreply.github.com>

commit d3ef3c0
Author: lL1l1 <82986251+lL1l1@users.noreply.github.com>
Date:   Sun Apr 21 10:02:18 2024 -0700

    Inherit all damage data in Ahwassa bomb script (FAForever#6102)

commit f925f48
Author: lL1l1 <82986251+lL1l1@users.noreply.github.com>
Date:   Sat Apr 20 22:21:57 2024 -0700

    Refactor collision beams (FAForever#6065)

commit 24abffa
Author: G C <37224614+Hdt80bro@users.noreply.github.com>
Date:   Sat Apr 20 08:45:44 2024 -0700

    Quicken inevitable voting results (FAForever#5088)

commit 2547d18
Author: (Jip) Willem Wijnia <w.b.wijnia@gmail.com>
Date:   Sat Apr 20 09:28:24 2024 +0200

    Introduce basic anti-spam protection from taunts (FAForever#6099)

commit 1635090
Author: (Jip) Willem Wijnia <w.b.wijnia@gmail.com>
Date:   Sat Apr 20 09:25:23 2024 +0200

    Revert "Remove mass from dead trees and tree groups" (FAForever#6101)

commit ca94bd8
Author: lL1l1 <82986251+lL1l1@users.noreply.github.com>
Date:   Fri Apr 19 15:09:17 2024 -0700

    Revert "Remove mass from dead trees and tree groups" (FAForever#6100)

commit 524fc7f
Author: clyf <clyfordv@gmail.com>
Date:   Fri Apr 19 10:42:27 2024 -0400

    Fix being able to detach the external factory of the primary unit (FAForever#6093)

commit 7993337
Author: lL1l1 <82986251+lL1l1@users.noreply.github.com>
Date:   Thu Apr 18 00:53:13 2024 -0700

    Revert hoplite firing from transports (FAForever#6094)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants