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

Revert FiringState OnLostTarget working through HaltFire #6289

Merged

Conversation

lL1l1
Copy link
Contributor

@lL1l1 lL1l1 commented Jun 22, 2024

Description of the proposed changes

Essentially reverts it to Steam behavior, except we have the fix for the state to call the base class.

  • ✔️ Fixes ythotha storm not attacking the ground or allies by removing the hasTarget check and re-adding the base class call.
  • ✔️ Fixes projectile weapons (but not beams) not firing their last shot in AttackGroundTries.
  • ❌ Non-packing weapons will fire their salvo off into the air. Thankfully there are few of them. The actual solution to this is to add a proper salvo retargeting system, which is beyond the scope of the PR, so there are just some hack fix exceptions.

Testing done on the proposed changes

Tested units with various firing cycles, particularly relevant are Ravager, Ythotha and its storm, GC Beam after tractoring something, and Scathis.

Spawn units command:
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xsl0301_missile', 0,    3.82,    0.50,  0.00000)
   CreateUnitAtMouse('dslk004', 0,   11.82,   -4.50,  0.00000)
   CreateUnitAtMouse('delk002', 0,    8.82,   -4.50,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xsb2301', 0,   -4.24,    1.83,  2.64765)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xsb2401', 0,   -8.24,   -8.17,  0.00000)
   CreateUnitAtMouse('drl0204', 0,   10.15,   -0.33,  0.02394)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('urb2108', 0,    9.76,    5.83,  0.00000)
   CreateUnitAtMouse('uel0001', 0,    2.17,    5.30,  0.51364)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('url0401', 0,  -11.74,    7.08, -0.00668)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xsb2108', 0,   12.76,    6.83,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xel0306', 0,   -2.10,    5.51, -0.57607)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xeb2306', 0,   -8.24,    7.83,  2.60117)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xsl0401', 0,   14.76,    0.83, -0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xab1401', 0,   -1.24,   -8.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('url0304', 0,   -5.25,    5.22,  0.23978)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('del0204', 0,    6.23,    5.95,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('drlk001', 0,    5.82,   -4.50,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('xrb0304', 0,   -0.24,   -0.17,  0.00000)
   CreateUnitAtMouse('ual0401', 0,  -18.30,   -3.43,  0.21756)

Checklist

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

lL1l1 added 16 commits June 21, 2024 19:32
Fixes lightning storm ground attacking
Removing Haltfire usage prevents Scathis state locking up when losing target when in firing state that required this target check
Essentially reverts it to Steam behavior, except we have the fix for the state to call the base class
Changing states kills the thread and cancels any firing, which prevents the last shot on AttackGroundTries from firing.
This reverts commit 9bb0917.
Needed for weapons like Ythotha's to not look ridiculous firing into empty space.
This reverts commit bd60d26.
Non-packing weapons can't cancel their salvos and will shoot into the air
@lL1l1 lL1l1 added type: bug area: sim Area that is affected by the Simulation of the Game feature: weapon firing cycle related to the weapon firing cycle labels Jun 22, 2024
@MrRowey MrRowey merged commit 4a6fc47 into FAForever:develop Jun 25, 2024
5 checks passed
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: weapon firing cycle related to the weapon firing cycle type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants