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 error with new stop command pausing silos #6617

Merged
merged 5 commits into from
Jan 25, 2025

Conversation

lL1l1
Copy link
Contributor

@lL1l1 lL1l1 commented Jan 14, 2025

Issue

IssueUnitCommand was being given a UserUnit instead of a UserUnit[] in the new behavior from #6557, causing the following error:

WARNING: Error running HandleEvent script in CScriptObject at 19c8a700: ...rs\colon3\documents\github\fa\lua\ui\game\orders.lua(332): Expected a game object. (Did you call with '.' instead of ':'?)
         stack traceback:
         	[C]: in function `IssueUnitCommand'
         	...rs\colon3\documents\github\fa\lua\ui\game\orders.lua(332): in function `Stop'
         	...rs\colon3\documents\github\fa\lua\ui\game\orders.lua(355): in function `OnClick'
         	...ers\colon3\documents\github\fa\lua\maui\checkbox.lua(143): in function `HandleEvent'
         	...rs\colon3\documents\github\fa\lua\ui\game\orders.lua(1303): in function <...rs\colon3\documents\github\fa\lua\ui\game\orders.lua:1281>

Description of the proposed changes

  • Like was done for a few other User functions, add a single unit version of IssueUnitCommand.
    • Use this new function in the stop order behavior to correctly issue the pause order to the silos.
  • Fix the shift version of stop not using the new stop behavior.
  • related annotations

Testing done on the proposed changes

Spawn some silos and make sure the stop command and its shift version work

   CreateUnitAtMouse('xsb2108', 0,    0.00,   -2.00, -0.00000)
   CreateUnitAtMouse('xsb2108', 0,    0.00,    0.00, -0.00000)
   CreateUnitAtMouse('xsb2108', 0,    0.00,    2.00, -0.00000)

Checklist

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

@lL1l1 lL1l1 added type: bug area: ui Anything to do with the User Interface of the Game labels Jan 14, 2025
@lL1l1 lL1l1 added this to the Development Iteration I of 2025 milestone Jan 14, 2025
@lL1l1 lL1l1 requested a review from clyfordv January 14, 2025 04:42
@lL1l1 lL1l1 marked this pull request as ready for review January 14, 2025 04:46
Copy link
Member

@Garanas Garanas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as promised!

@Garanas Garanas merged commit 7f7e353 into FAForever:develop Jan 25, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ui Anything to do with the User Interface of the Game type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants