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

Check if instigator is destroyed in Fatboy DeathThread #6629

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

lL1l1
Copy link
Contributor

@lL1l1 lL1l1 commented Jan 18, 2025

Issue

Since the instigator is used in a thread, and threads start 1 tick later, it can be passed from OnKilled and then get destroyed.
Replay: https://replay.faforever.com/24087043 Right side fatboy for south team at 29:00 errors out when dying
Error:

warning: Error running lua script: ...\gamedata\units.nx2\units\uel0401\uel0401_script.lua(263): Game object has been destroyed
         stack traceback:
         	[C]: in function `GetPositionXYZ'
         	...\gamedata\units.nx2\units\uel0401\uel0401_script.lua(263): in function <...\gamedata\units.nx2\units\uel0401\uel0401_script.lua:253>

Description of the proposed changes

  • Check if the instigator was destroyed before calling GetPositionXYZ on it. I didn't opt for using Unit.Dead because this code won't run often and .Dead is true after dying, which is before C-object destruction.

Testing done on the proposed changes

  • Running the replay from deploy/faf (805bdd3) with the fix commit cherry picked on top causes the fatboy to successfully die
  • Checked that no other DeathThreads use the instigator value.

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: sim Area that is affected by the Simulation of the Game labels Jan 18, 2025
@lL1l1 lL1l1 added this to the Development Iteration I of 2025 milestone Jan 18, 2025
@lL1l1 lL1l1 marked this pull request as ready for review January 18, 2025 05:14
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.

1 participant