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
+2
View File
@@ -47,6 +47,7 @@ private:
float reflectionUpdateTimer=0;
float reflectionStepTime=0;
std::set<vi2d>visibleTiles;
std::vector<Monster>monstersToBeSpawned;
public:
Crawler();
bool OnUserCreate() override;
@@ -108,6 +109,7 @@ public:
void RenderTile(vi2d pos,TilesheetData tileSheet,int tileSheetIndex,vi2d tileSheetPos);
void RenderTile(TileRenderData&tileSheet,Pixel col);
bool IsReflectiveTile(TilesheetData tileSheet,int tileID);
void SpawnMonster(vf2d pos,MonsterData*data,bool upperLevel=false); //Queues a monster for spawning on the next frame.
struct TileGroupData{
vi2d tilePos;