Skip to content

Fix known Enemy Randomizer crashes#2242

Merged
briaguya0 merged 1 commit intoHarbourMasters:develop-bradleyfrom
aMannus:fix-enemyrando-crashes
Dec 24, 2022
Merged

Fix known Enemy Randomizer crashes#2242
briaguya0 merged 1 commit intoHarbourMasters:develop-bradleyfrom
aMannus:fix-enemyrando-crashes

Conversation

@aMannus
Copy link
Contributor

@aMannus aMannus commented Dec 22, 2022

The comment in the code should explain what this does pretty well.

The peahat tries to set a property of its parent which is normally a big peahat, but when spawned from anywhere else, that parent won't have that property to begin with, which leads to a crash when it dies. It only sets this property when it has a parent in the first place, so removing the parent is fine.

The floormaster tries to set its parent and child to another copy of itself when it dies and splits, which also crashes when the parent actor is already assigned/populated.

I've searched through every single instance of Actor_SpawnAsChild, and the only 3 times where it's used to spawn an enemy (that is eligible for randomization) is already handled through earlier changes I've made for Enemy Randomizer (see code comment).

I've also tested every single enemy in-game just to make sure I didn't miss any, and it's only the small peahats and floormasters that cause a crash when spawned as a child actor.

Build Artifacts

@briaguya0 briaguya0 merged commit 07bae6b into HarbourMasters:develop-bradley Dec 24, 2022
@aMannus aMannus deleted the fix-enemyrando-crashes branch December 24, 2022 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants