mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-02-16 23:30:15 -05:00
Enemy Rando Hyrule Field crash hotfix (#2222)
This commit is contained in:
parent
8c8111c7b8
commit
e03ef85f3b
@ -239,10 +239,14 @@ void EnEncount1_SpawnStalchildOrWolfos(EnEncount1* this, PlayState* play) {
|
|||||||
spawnPos = this->actor.world.pos;
|
spawnPos = this->actor.world.pos;
|
||||||
// In authentic gameplay, the game checks how many Stalchildren were spawned and only spawns new ones
|
// In authentic gameplay, the game checks how many Stalchildren were spawned and only spawns new ones
|
||||||
// when the old ones are despawned and a timer is reached.
|
// when the old ones are despawned and a timer is reached.
|
||||||
// With Enemy Randomizer on, this will keep spawning enemies solely on the timer because it's much
|
// With Enemy Randomizer on, this will keep spawning enemies based on the timer and the total amount of existing
|
||||||
// more difficult tracking how many enemies have been spawned/killed. It's also fun. :)
|
// enemies because it's much more difficult tracking how many enemies specifically spawned by this spawner have
|
||||||
if ((this->curNumSpawn < this->maxCurSpawns && this->totalNumSpawn < this->maxTotalSpawns) || CVar_GetS32("gRandomizedEnemies", 0)) {
|
// been spawned and/or killed.
|
||||||
while ((this->curNumSpawn < this->maxCurSpawns && this->totalNumSpawn < this->maxTotalSpawns) || CVar_GetS32("gRandomizedEnemies", 0)) {
|
int8_t enemyCount = play->actorCtx.actorLists[ACTORCAT_ENEMY].length;
|
||||||
|
if ((this->curNumSpawn < this->maxCurSpawns && this->totalNumSpawn < this->maxTotalSpawns) ||
|
||||||
|
(CVar_GetS32("gRandomizedEnemies", 0) && enemyCount < 15)) {
|
||||||
|
while ((this->curNumSpawn < this->maxCurSpawns && this->totalNumSpawn < this->maxTotalSpawns) ||
|
||||||
|
(CVar_GetS32("gRandomizedEnemies", 0) && enemyCount < 15)) {
|
||||||
if (play->sceneNum == SCENE_SPOT00) {
|
if (play->sceneNum == SCENE_SPOT00) {
|
||||||
if ((player->unk_89E == 0) || (player->actor.floorBgId != BGCHECK_SCENE) ||
|
if ((player->unk_89E == 0) || (player->actor.floorBgId != BGCHECK_SCENE) ||
|
||||||
!(player->actor.bgCheckFlags & 1) || (player->stateFlags1 & 0x08000000)) {
|
!(player->actor.bgCheckFlags & 1) || (player->stateFlags1 & 0x08000000)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user