From 0a30b0df80c467d75eb900db0186b694b28aee62 Mon Sep 17 00:00:00 2001
From: Star Rauchenberger <fefferburbia@gmail.com>
Date: Tue, 1 Apr 2025 09:38:29 -0400
Subject: Revert "Add workaround for 0.5.1 number hunt logic bug"

This reverts commit 1cb943a4a68ea5d0fee65672321405c4697f5136.
---
 src/game_data.cpp | 29 +----------------------------
 1 file changed, 1 insertion(+), 28 deletions(-)

(limited to 'src/game_data.cpp')

diff --git a/src/game_data.cpp b/src/game_data.cpp
index 7ce1fb6..94b9888 100644
--- a/src/game_data.cpp
+++ b/src/game_data.cpp
@@ -29,7 +29,6 @@ struct GameData {
   std::map<std::string, int> painting_by_id_;
 
   std::vector<int> door_definition_order_;
-  std::vector<int> room_definition_order_;
 
   std::map<std::string, int> room_by_painting_;
   std::map<int, int> room_by_sunwarp_;
@@ -92,7 +91,6 @@ struct GameData {
 
     for (const auto &room_it : lingo_config) {
       int room_id = AddOrGetRoom(room_it.first.as<std::string>());
-      room_definition_order_.push_back(room_id);
 
       for (const auto &entrance_it : room_it.second["entrances"]) {
         int from_room_id = AddOrGetRoom(entrance_it.first.as<std::string>());
@@ -780,31 +778,6 @@ struct GameData {
       }
     }
 
-    // As a workaround for a generator bug in 0.5.1, we are going to remove the
-    // panel door requirement on panels that are defined earlier in the file than
-    // the panel door is. This results in logic that matches the generator, even
-    // if it is not true to how the game should work. This will be reverted once
-    // the logic bug is fixed and released.
-    // See: https://github.com/ArchipelagoMW/Archipelago/pull/4342
-    for (Panel& panel : panels_) {
-      if (panel.panel_door == -1) {
-        continue;
-      }
-      const PanelDoor &panel_door = panel_doors_[panel.panel_door];
-      for (int room_id : room_definition_order_) {
-        if (room_id == panel_door.room) {
-          // The panel door was defined first (or at the same time as the panel),
-          // so we're good.
-          break;
-        } else if (room_id == panel.room) {
-          // The panel was defined first, so we have to pretend the panel door is
-          // not required for this panel.
-          panel.panel_door = -1;
-          break;
-        }
-      }
-    }
-
     // Report errors.
     for (const std::string &area : malconfigured_areas_) {
       TrackerLog(fmt::format("Area data not found for: {}", area));
@@ -937,7 +910,7 @@ struct GameData {
     if (!panel_doors_by_id_.count(full_name)) {
       int panel_door_id = panel_doors_.size();
       panel_doors_by_id_[full_name] = panel_door_id;
-      panel_doors_.push_back({.room = AddOrGetRoom(room)});
+      panel_doors_.push_back({});
     }
 
     return panel_doors_by_id_[full_name];
-- 
cgit 1.4.1