Monster spawning now adds to a queue to prevent memory adjustment corruption while inside of monster update functions.

Monster spawning on phase transition now occurs.
This commit is contained in:
2023-09-19 03:30:18 -05:00
parent c816a0eac7
commit 74a31dda2e
7 changed files with 62 additions and 5 deletions
+1 -1
View File
@@ -286,7 +286,7 @@ void MonsterSpawner::SetTriggered(bool trigger,bool spawnMonsters){
triggered=trigger;
if(spawnMonsters){
for(std::pair<int,vf2d>&monsterInfo:monsters){
MONSTER_LIST.push_back(Monster(pos+monsterInfo.second,MONSTER_DATA[monsterInfo.first],DoesUpperLevelSpawning()));
game->SpawnMonster(pos+monsterInfo.second,&MONSTER_DATA[monsterInfo.first],DoesUpperLevelSpawning());
}
}
}