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:
@@ -121,6 +121,10 @@ bool Crawler::OnUserUpdate(float fElapsedTime){
|
||||
for(Monster&m:MONSTER_LIST){
|
||||
m.Update(fElapsedTime);
|
||||
}
|
||||
for(Monster&m:monstersToBeSpawned){
|
||||
MONSTER_LIST.push_back(m);
|
||||
}
|
||||
monstersToBeSpawned.clear();
|
||||
UpdateBullets(fElapsedTime);
|
||||
UpdateCamera(fElapsedTime);
|
||||
RenderWorld(fElapsedTime);
|
||||
@@ -1374,4 +1378,8 @@ void Crawler::InitializeLevels(){
|
||||
INITLEVEL(CAMPAIGN_1_2);
|
||||
|
||||
LEVEL_NAMES.SetInitialized();
|
||||
}
|
||||
|
||||
void Crawler::SpawnMonster(vf2d pos,MonsterData*data,bool upperLevel){
|
||||
monstersToBeSpawned.push_back(Monster(pos,*data,upperLevel));
|
||||
}
|
||||
Reference in New Issue
Block a user