1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-02-18 02:34:57 +00:00

Fix map grid not drawing and tiles not regenerating after editor obs regen (F11)

forgot to get max grid dimensions after clearing and recomputing the grid
This commit is contained in:
fgenesis 2024-05-06 04:26:54 +02:00
parent 0326800940
commit 3adc3f0c99
3 changed files with 12 additions and 3 deletions

View file

@ -556,7 +556,7 @@ void Game::reconstructGrid(bool force)
dsq->tilemgr.exportGridFillers(fillers);
std::ostringstream os;
os << "ReconstructGrid using " << fillers.size() << " tiles";
os << "ReconstructGrid using " << fillers.size() << " solid tiles";
debugLog(os.str());
for (size_t i = 0; i < fillers.size(); i++)
@ -1802,6 +1802,14 @@ next_SE:
return true;
}
void Game::handleEditorMapGridUpdate()
{
reconstructGrid(true);
findMaxCameraValues();
updateGridRender(OT_MASK_BLACK);
}
void Game::spawnEntities(const EntitySaveData *sav, size_t n)
{
std::vector<size_t> conflicting, usable;

View file

@ -400,6 +400,8 @@ public:
void onContinuityReset();
void onPrepareRender();
void handleEditorMapGridUpdate();
protected:
unsigned highestLoadedEntityID;

View file

@ -1623,8 +1623,7 @@ void SceneEditor::generateLevel()
}
}
game->reconstructGrid(true);
game->updateGridRender(OT_MASK_BLACK);
game->handleEditorMapGridUpdate();
maxX--;
maxY--;