about summary refs log tree commit diff stats
path: root/tracker_state.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tracker_state.cpp')
-rw-r--r--tracker_state.cpp34
1 files changed, 15 insertions, 19 deletions
diff --git a/tracker_state.cpp b/tracker_state.cpp index 62e4612..a84dd6e 100644 --- a/tracker_state.cpp +++ b/tracker_state.cpp
@@ -42,26 +42,23 @@ bool IsPanelReachable_Helper(int panel_id,
42bool IsDoorReachable_Helper(int door_id, const std::set<int>& reachable_rooms) { 42bool IsDoorReachable_Helper(int door_id, const std::set<int>& reachable_rooms) {
43 const Door& door_obj = GetGameData().GetDoor(door_id); 43 const Door& door_obj = GetGameData().GetDoor(door_id);
44 44
45 switch (GetAPState().GetDoorShuffleMode()) { 45 if (GetAPState().GetDoorShuffleMode() == kNO_DOORS || door_obj.skip_item) {
46 case DoorShuffleMode::kNone: { 46 if (!reachable_rooms.count(door_obj.room)) {
47 if (!reachable_rooms.count(door_obj.room)) { 47 return false;
48 return false; 48 }
49 }
50 49
51 for (int panel_id : door_obj.panels) { 50 for (int panel_id : door_obj.panels) {
52 if (!IsPanelReachable_Helper(panel_id, reachable_rooms)) { 51 if (!IsPanelReachable_Helper(panel_id, reachable_rooms)) {
53 return false; 52 return false;
54 }
55 } 53 }
56
57 return true;
58 }
59 case DoorShuffleMode::kSimple: {
60 break;
61 }
62 case DoorShuffleMode::kComplex: {
63 break;
64 } 54 }
55
56 return true;
57 } else if (GetAPState().GetDoorShuffleMode() == kSIMPLE_DOORS &&
58 !door_obj.group_name.empty()) {
59 return GetAPState().HasItem(door_obj.group_name);
60 } else {
61 return GetAPState().HasItem(door_obj.item_name);
65 } 62 }
66} 63}
67 64
@@ -88,8 +85,7 @@ void TrackerState::CalculateState() {
88 if (room_exit.door.has_value()) { 85 if (room_exit.door.has_value()) {
89 if (IsDoorReachable_Helper(*room_exit.door, reachable_rooms)) { 86 if (IsDoorReachable_Helper(*room_exit.door, reachable_rooms)) {
90 valid_transition = true; 87 valid_transition = true;
91 } else if (GetAPState().GetDoorShuffleMode() == 88 } else if (GetAPState().GetDoorShuffleMode() == kNO_DOORS) {
92 DoorShuffleMode::kNone) {
93 new_boundary.push_back(room_exit); 89 new_boundary.push_back(room_exit);
94 } 90 }
95 } else { 91 } else {