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 on death when ACU/SACU drone pods are built without ACU/SACU #6614

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

Conversation

lL1l1
Copy link
Contributor

@lL1l1 lL1l1 commented Jan 12, 2025

Issue

If drone pods are built without an ACU/SACU they cause an error on death and don't get cleaned up. This can happen by cheat spawning them or by being built from a factory like in the common "All Faction Quantum Gate" mod.

warning: Error running OnKilled script in Entity uea0003 at 23591f08: ...github\fa\lua\sim\units\uef\tconstructionpodunit.lua(191): attempt to call method `NotifyOfPodDeath' (a nil value)
         stack traceback:
         	...github\fa\lua\sim\units\uef\tconstructionpodunit.lua(191): in function <...github\fa\lua\sim\units\uef\tconstructionpodunit.lua:190>

Description of the proposed changes

  • Add a nil check for self.Parent, as the parent only gets set by units specifically scripted to use the pod's SetParent function.
  • Intellisense work in related scripts

Testing done on the proposed changes

Spawning pods with the cheat menu no longer causes an error, and they die properly.

Additional context

Curiously, pods are attached to the creator unit through I believe the engine, so they die instantly when cheat spawned or if the creator dies.

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 12, 2025
@lL1l1 lL1l1 added this to the Development Iteration I of 2025 milestone Jan 12, 2025
@lL1l1 lL1l1 marked this pull request as ready for review January 12, 2025 10:09
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