diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2025-10-17 18:17:28 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2025-10-17 18:17:28 -0400 |
commit | 8ea8aef094f73ff6d16f209267c4037399a9a3e7 (patch) | |
tree | e57715322a449b1769f6937937f9dd81fd4b858b | |
parent | 1c1b6e7db5ebe0d0d4148777c87bc512599b8537 (diff) | |
download | lingo2-archipelago-8ea8aef094f73ff6d16f209267c4037399a9a3e7.tar.gz lingo2-archipelago-8ea8aef094f73ff6d16f209267c4037399a9a3e7.tar.bz2 lingo2-archipelago-8ea8aef094f73ff6d16f209267c4037399a9a3e7.zip |
Fixed deep copy when merging requirements
-rw-r--r-- | apworld/player_logic.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apworld/player_logic.py b/apworld/player_logic.py index 84c93c8..5271ed1 100644 --- a/apworld/player_logic.py +++ b/apworld/player_logic.py | |||
@@ -73,7 +73,7 @@ class AccessRequirements: | |||
73 | self.cyans = self.cyans or other.cyans | 73 | self.cyans = self.cyans or other.cyans |
74 | 74 | ||
75 | for disjunction in other.or_logic: | 75 | for disjunction in other.or_logic: |
76 | self.or_logic.append(disjunction) | 76 | self.or_logic.append([sub_req.copy() for sub_req in disjunction]) |
77 | 77 | ||
78 | if other.complete_at is not None: | 78 | if other.complete_at is not None: |
79 | # Merging multiple requirements that use complete_at sucks, and is part of why we want to minimize use of | 79 | # Merging multiple requirements that use complete_at sucks, and is part of why we want to minimize use of |
@@ -84,7 +84,7 @@ class AccessRequirements: | |||
84 | 84 | ||
85 | left_req = AccessRequirements() | 85 | left_req = AccessRequirements() |
86 | left_req.complete_at = self.complete_at | 86 | left_req.complete_at = self.complete_at |
87 | left_req.possibilities = self.possibilities | 87 | left_req.possibilities = [sub_req.copy() for sub_req in self.possibilities] |
88 | self.or_logic.append([left_req]) | 88 | self.or_logic.append([left_req]) |
89 | 89 | ||
90 | self.complete_at = None | 90 | self.complete_at = None |
@@ -92,11 +92,11 @@ class AccessRequirements: | |||
92 | 92 | ||
93 | right_req = AccessRequirements() | 93 | right_req = AccessRequirements() |
94 | right_req.complete_at = other.complete_at | 94 | right_req.complete_at = other.complete_at |
95 | right_req.possibilities = other.possibilities | 95 | right_req.possibilities = [sub_req.copy() for sub_req in other.possibilities] |
96 | self.or_logic.append([right_req]) | 96 | self.or_logic.append([right_req]) |
97 | else: | 97 | else: |
98 | self.complete_at = other.complete_at | 98 | self.complete_at = other.complete_at |
99 | self.possibilities = other.possibilities | 99 | self.possibilities = [sub_req.copy() for sub_req in other.possibilities] |
100 | 100 | ||
101 | def is_empty(self) -> bool: | 101 | def is_empty(self) -> bool: |
102 | return (len(self.items) == 0 and len(self.progressives) == 0 and len(self.rooms) == 0 and len(self.letters) == 0 | 102 | return (len(self.items) == 0 and len(self.progressives) == 0 and len(self.rooms) == 0 and len(self.letters) == 0 |