Did a full code review to identify things to fix and either fixed them or noted BUG where I should come back.

This commit is contained in:
Zed A. Shaw 2024-12-04 21:43:59 -05:00
parent ae43dad499
commit 9abb39a3bf
14 changed files with 72 additions and 35 deletions

View file

@ -21,8 +21,11 @@ void save::to_file(fs::path path, DinkyECS::World &world, Map &map) {
tser::BinaryArchive archive;
save_data.facts.player = world.get_the<Player>();
save_data.map = MapData{map.$rooms, map.$walls, map.$limit};
save_data.map = MapData{
map.$limit, map.$width, map.$height,
map.$rooms, map.$walls};
// BUG: lights aren't saved/restored
extract<Position>(world, save_data.position);
extract<Combat>(world, save_data.combat);
extract<Motion>(world, save_data.motion);
@ -71,8 +74,8 @@ void save::from_file(fs::path path, DinkyECS::World &world_out, Map &map_out) {
inject<Tile>(world_out, save_data.tile);
inject<Inventory>(world_out, save_data.inventory);
size_t width = save_data.map.walls[0].size();
size_t height = save_data.map.walls.size();
size_t width = save_data.map.width;
size_t height = save_data.map.height;
int limit = save_data.map.limit;
Pathing paths(width, height, limit);