about summary refs log tree commit diff stats
path: root/src/tracker_state.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tracker_state.cpp')
-rw-r--r--src/tracker_state.cpp37
1 files changed, 35 insertions, 2 deletions
diff --git a/src/tracker_state.cpp b/src/tracker_state.cpp index e02ee14..43f84b4 100644 --- a/src/tracker_state.cpp +++ b/src/tracker_state.cpp
@@ -182,13 +182,46 @@ void RecalculateReachability() {
182 182
183 bool valid_transition = false; 183 bool valid_transition = false;
184 if (room_exit.door.has_value()) { 184 if (room_exit.door.has_value()) {
185 Decision door_reachable = IsDoorReachable_Helper( 185 Decision door_reachable = kMaybe;
186 *room_exit.door, reachable_rooms, solveable_panels); 186 if (room_exit.sunwarp) {
187 if (AP_GetSunwarpAccess() == kSUNWARP_ACCESS_NORMAL) {
188 door_reachable = kYes;
189 } else if (AP_GetSunwarpAccess() == kSUNWARP_ACCESS_DISABLED) {
190 door_reachable = kNo;
191 } else {
192 door_reachable = IsDoorReachable_Helper(
193 *room_exit.door, reachable_rooms, solveable_panels);
194 }
195 } else {
196 door_reachable = IsDoorReachable_Helper(
197 *room_exit.door, reachable_rooms, solveable_panels);
198 }
187 if (door_reachable == kYes) { 199 if (door_reachable == kYes) {
188 valid_transition = true; 200 valid_transition = true;
189 } else if (door_reachable == kMaybe) { 201 } else if (door_reachable == kMaybe) {
190 new_boundary.push_back(room_exit); 202 new_boundary.push_back(room_exit);
191 } 203 }
204 } else if (room_exit.pilgrimage) {
205 Decision pilgrimage_reachable = kYes;
206 if (AP_GetSunwarpAccess() == kSUNWARP_ACCESS_DISABLED) {
207 pilgrimage_reachable = kNo;
208 }
209 if (pilgrimage_reachable == kYes) {
210 for (int door_id : GD_GetPilgrimageDoors(
211 AP_GetSunwarpAccess() == kSUNWARP_ACCESS_UNLOCK ||
212 AP_GetSunwarpAccess() == kSUNWARP_ACCESS_PROGRESSIVE)) {
213 pilgrimage_reachable = IsDoorReachable_Helper(
214 door_id, reachable_rooms, solveable_panels);
215 if (pilgrimage_reachable != kYes) {
216 break;
217 }
218 }
219 }
220 if (pilgrimage_reachable == kYes) {
221 valid_transition = true;
222 } else if (pilgrimage_reachable == kMaybe) {
223 new_boundary.push_back(room_exit);
224 }
192 } else { 225 } else {
193 valid_transition = true; 226 valid_transition = true;
194 } 227 }