Had to refactor the GameDB to use a list of levels instead of a vector of levels. If you get a _reference_ to an element of a vector, and then resize the vector, you'll get a crash if the realoc moves the data buffer. Using a list is actually what we want.

This commit is contained in:
Zed A. Shaw 2025-12-16 11:40:29 -05:00
parent bf8ce7e16b
commit 0456c73e4f
6 changed files with 53 additions and 37 deletions

View file

@ -13,8 +13,8 @@ namespace components {
namespace GameDB {
struct Level {
size_t index;
DinkyECS::Entity player;
size_t index = 0;
DinkyECS::Entity player = DinkyECS::NONE;
std::shared_ptr<Map> map = nullptr;
std::shared_ptr<DinkyECS::World> world = nullptr;
std::shared_ptr<lighting::LightRender> lights = nullptr;
@ -31,4 +31,5 @@ namespace GameDB {
std::shared_ptr<DinkyECS::World> clone_load_world(std::shared_ptr<DinkyECS::World> prev_world);
void load_configs(DinkyECS::World &world);
void register_level(Level level);
}