Skip to content

Conversation

@lL1l1
Copy link
Contributor

@lL1l1 lL1l1 commented Mar 22, 2025

Issue

You can do "OnStopBuild" with an unfinished unit by cancelling a BuildMobile order on the ground. This gets the factory locked up since there is no way to remove the unfinished unit.

{EEAB1C1F-DD16-4452-9024-B40D635282E2}

Description of the proposed changes

Destroy unbuilt units in FactoryUnit.OnStopBuild

Testing done on the proposed changes

An unfinished unit no longer remains in the factory after the mobile build order is cancelled.
Copy-paste command for testing:

CreateUnitAtMouse('urb0301', 0,    0.00,    0.00, -0.00000)
ForkThread(function() 
WaitTicks(10) 
ConExecute('UI_SelectByCategory +nearest FACTORY CYBRAN TECH3')
import('/lua/ui/game/commandmode.lua').StartCommandMode('build', {name = 'url0303'}) 
end)

Checklist

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

You can do "OnStopBuild" with an unfinished unit by cancelling a `BuildMobile` order on the ground
@lL1l1 lL1l1 added type: bug area: sim Area that is affected by the Simulation of the Game labels Mar 22, 2025
@lL1l1 lL1l1 marked this pull request as ready for review March 22, 2025 08:58
@speed2CZ speed2CZ merged commit c544077 into FAForever:develop Apr 3, 2025
5 checks passed
lL1l1 added a commit to lL1l1/fa that referenced this pull request Aug 22, 2025
- Only call for the edge case when the build does not fail but the unit is incomplete.
- Use proper callbacks instead of relying on the normal finish build behavior to stop build fx and destroying the unit manually
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 type: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants