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:
parent
ae43dad499
commit
9abb39a3bf
14 changed files with 72 additions and 35 deletions
9
save.cpp
9
save.cpp
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue