Skip to content

Commit

Permalink
[OSRS] Fixes Incorrect filler item names causing failures on tests. (#…
Browse files Browse the repository at this point in the history
…3768)

* Updates filler item names to match the actual item names

* Adds more descriptive error message in case this error comes back

* Properly raises exception instead of just text

* Replaces exception with assert
  • Loading branch information
digiholic authored Aug 16, 2024
1 parent e9c863d commit c014c5a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions worlds/osrs/Names.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ class ItemNames(str, Enum):
Progressive_Armor = "Progressive Armor"
Progressive_Weapons = "Progressive Weapons"
Progressive_Tools = "Progressive Tools"
Progressive_Range_Armor = "Progressive Range Armor"
Progressive_Range_Weapon = "Progressive Range Weapon"
Progressive_Magic = "Progressive Magic Spell"
Progressive_Range_Armor = "Progressive Ranged Armor"
Progressive_Range_Weapon = "Progressive Ranged Weapons"
Progressive_Magic = "Progressive Magic"
Lobsters = "10 Lobsters"
Swordfish = "5 Swordfish"
Energy_Potions = "10 Energy Potions"
Expand Down
4 changes: 3 additions & 1 deletion worlds/osrs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,9 @@ def create_region(self, name: str) -> "Region":
return region

def create_item(self, item_name: str) -> "Item":
item = [item for item in item_rows if item.name == item_name][0]
items = [item for item in item_rows if item.name == item_name]
assert len(items) > 0, f"No matching item found for name {item_name} for player {self.player_name}"
item = items[0]
index = item_rows.index(item)
return OSRSItem(item.name, item.progression, self.base_id + index, self.player)

Expand Down

0 comments on commit c014c5a

Please sign in to comment.