Skip to content

Conversation

@lL1l1
Copy link
Contributor

@lL1l1 lL1l1 commented Mar 22, 2025

Issue

First reported by @4z0t.
When a BuildMobile order is cancelled, OnStopBuild is called with an unbuilt unit. Carriers will put the unbuilt unit into their storage at that point because there are no checks for this scenario. Fatboy places the unbuilt unit on the ground. A BuildMobile order can be issued to factories trivially using UI mods. Thankfully it isn't a huge exploit because the unbuilt units are still unbuilt when they come out of storage.

put.unbuilt.units.into.carriers.mp4

After deployment:
{90E9B0B3-9C13-43B7-A537-642E07BCDC61}

Description of the proposed changes

  • Carriers (Czar and all navy): Destroy unbuilt units in OnStopBuildWithStorage in the external factory component.
  • Fatboy: Destroy unbuilt units in the OnStopBuild functions.

Testing done on the proposed changes

Spawn a carrier, select the external factory, and then issue a buildmobile order within 5 range (default buildrange) near the rear of the carrier where the external factory is actually located. Then move the build order around to cancel it repeatedly. No units should be added to the carrier's storage.

CreateUnitAtMouse('uas0303', 0,    0.00,    0.00,  0.00000)
import('/lua/ui/game/commandmode.lua').StartCommandMode('build', {name = 'uaa0304'})

Fatboy test:
Execution is similar to the carrier but Fatboy has animations and delays so those have to be accounted for. It also does not use the same OnStopBuildWithStorage function.

CreateUnitAtMouse('uel0401', 0,    0.00,    0.00, -0.00000)
import('/lua/ui/game/commandmode.lua').StartCommandMode('build', {name = 'uel0304'})

Checklist

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

lL1l1 added 2 commits March 22, 2025 02:25
This can be done by finishing the build order by moving around a BuildMobile order on the ground
@lL1l1 lL1l1 added type: bug area: sim Area that is affected by the Simulation of the Game feature: mobile factories related to mobile factory functionality labels Mar 22, 2025
@lL1l1 lL1l1 marked this pull request as ready for review March 22, 2025 09:47
@lL1l1 lL1l1 mentioned this pull request Mar 31, 2025
6 tasks
@BlackYps BlackYps merged commit a874060 into FAForever:develop Mar 31, 2025
5 checks passed
BlackYps pushed a commit that referenced this pull request Mar 31, 2025
…rnal factories and cancelled (#6702)

(cherry picked from commit a874060)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: sim Area that is affected by the Simulation of the Game feature: mobile factories related to mobile factory functionality type: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants