about summary refs log tree commit diff stats
path: root/src/game_data.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game_data.cpp')
-rw-r--r--src/game_data.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/game_data.cpp b/src/game_data.cpp index 5776c6c..6f1a2e4 100644 --- a/src/game_data.cpp +++ b/src/game_data.cpp
@@ -427,12 +427,13 @@ struct GameData {
427 if (room_it.second["paintings"]) { 427 if (room_it.second["paintings"]) {
428 for (const auto &painting : room_it.second["paintings"]) { 428 for (const auto &painting : room_it.second["paintings"]) {
429 std::string internal_id = painting["id"].as<std::string>(); 429 std::string internal_id = painting["id"].as<std::string>();
430 int painting_id = AddOrGetPainting(internal_id);
431 PaintingExit &painting_exit = paintings_[painting_id];
432 painting_exit.room = room_id;
430 433
431 if ((!painting["exit_only"] || !painting["exit_only"].as<bool>()) && 434 if ((!painting["exit_only"] || !painting["exit_only"].as<bool>()) &&
432 (!painting["disable"] || !painting["disable"].as<bool>())) { 435 (!painting["disable"] || !painting["disable"].as<bool>())) {
433 int painting_id = AddOrGetPainting(internal_id); 436 painting_exit.entrance = true;
434 PaintingExit &painting_exit = paintings_[painting_id];
435 painting_exit.room = room_id;
436 437
437 if (painting["required_door"]) { 438 if (painting["required_door"]) {
438 std::string rd_room = rooms_[room_id].name; 439 std::string rd_room = rooms_[room_id].name;
@@ -443,9 +444,9 @@ struct GameData {
443 painting_exit.door = AddOrGetDoor( 444 painting_exit.door = AddOrGetDoor(
444 rd_room, painting["required_door"]["door"].as<std::string>()); 445 rd_room, painting["required_door"]["door"].as<std::string>());
445 } 446 }
446
447 rooms_[room_id].paintings.push_back(painting_exit.id);
448 } 447 }
448
449 rooms_[room_id].paintings.push_back(painting_exit.id);
449 } 450 }
450 } 451 }
451 452
@@ -627,7 +628,10 @@ struct GameData {
627 MapArea &map_area = map_areas_[area_id]; 628 MapArea &map_area = map_areas_[area_id];
628 629
629 for (int painting_id : room.paintings) { 630 for (int painting_id : room.paintings) {
630 map_area.paintings.push_back(painting_id); 631 const PaintingExit &painting_obj = paintings_.at(painting_id);
632 if (painting_obj.entrance) {
633 map_area.paintings.push_back(painting_id);
634 }
631 } 635 }
632 } 636 }
633 } 637 }