Fix error on death when ACU/SACU drone pods are built without ACU/SACU #6614
+47
−21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Description of the proposed changes
self.Parent
, as the parent only gets set by units specifically scripted to use the pod'sSetParent
function.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