mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-22 17:32:19 -05:00
Fix common enemy rando crashes (#2242)
This commit is contained in:
parent
6eaf51c2bd
commit
07bae6b84c
@ -3326,6 +3326,15 @@ Actor* Actor_SpawnAsChild(ActorContext* actorCtx, Actor* parent, PlayState* play
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// The following enemies break when the parent actor isn't the same as what would happen in authentic gameplay.
|
||||
// As such, don't assign a parent to them at all when spawned with Enemy Randomizer.
|
||||
// Gohma (z_boss_goma.c), the Stalchildren spawner (z_en_encount1.c) and the falling platform spawning Stalfos in
|
||||
// Forest Temple (z_bg_mori_bigst.c) that normally rely on this behaviour are changed when
|
||||
// Enemy Rando is on so they still work properly even without assigning a parent.
|
||||
if (CVar_GetS32("gRandomizedEnemies", 0) && (spawnedActor->id == ACTOR_EN_FLOORMAS || spawnedActor->id == ACTOR_EN_PEEHAT)) {
|
||||
return spawnedActor;
|
||||
}
|
||||
|
||||
parent->child = spawnedActor;
|
||||
spawnedActor->parent = parent;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user