Witness: Fix for Witness plando crashes. (#2092)
This commit is contained in:
@@ -234,6 +234,11 @@ class WitnessWorld(World):
|
||||
return slot_data
|
||||
|
||||
def create_item(self, item_name: str) -> Item:
|
||||
# If the player's plando options are malformed, the item_name parameter could be a dictionary containing the
|
||||
# name of the item, rather than the item itself. This is a workaround to prevent a crash.
|
||||
if type(item_name) is dict:
|
||||
item_name = list(item_name.keys())[0]
|
||||
|
||||
# this conditional is purely for unit tests, which need to be able to create an item before generate_early
|
||||
item_data: ItemData
|
||||
if hasattr(self, 'items') and self.items and item_name in self.items.item_data:
|
||||
|
||||
Reference in New Issue
Block a user