From c02c6ee58ca8b0e324f9ff922ba2616802cf35d8 Mon Sep 17 00:00:00 2001 From: CaitSith2 Date: Sun, 14 Aug 2022 12:34:46 -0700 Subject: [PATCH] Fix generation failure for Final Fantasy 1 and Dark Souls 3. (#907) * Fix generation failure for Final Fantasy 1. * Fix spoiler log giving "Location (Player x): Item (Player y)" for FF1. * Dark Soul 3 Items/Locations now get player names in spoiler log. --- BaseClasses.py | 2 +- worlds/dark_souls_3/__init__.py | 2 +- worlds/ff1/__init__.py | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/BaseClasses.py b/BaseClasses.py index 02a194ee..aa37a097 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -1202,7 +1202,7 @@ class Item: return self.__str__() def __str__(self) -> str: - if self.location: + if self.location and self.location.parent_region and self.location.parent_region.world: return self.location.parent_region.world.get_name_string_for_object(self) return f"{self.name} (Player {self.player})" diff --git a/worlds/dark_souls_3/__init__.py b/worlds/dark_souls_3/__init__.py index 3a5c26cc..7245499e 100644 --- a/worlds/dark_souls_3/__init__.py +++ b/worlds/dark_souls_3/__init__.py @@ -158,7 +158,7 @@ class DarkSouls3World(World): # For each region, add the associated locations retrieved from the corresponding location_table def create_region(self, region_name, location_table) -> Region: - new_region = Region(region_name, RegionType.Generic, region_name, self.player) + new_region = Region(region_name, RegionType.Generic, region_name, self.player, self.world) if location_table: for name, address in location_table.items(): location = DarkSouls3Location(self.player, name, self.location_name_to_id[name], new_region) diff --git a/worlds/ff1/__init__.py b/worlds/ff1/__init__.py index 9818bed9..d5a8dd30 100644 --- a/worlds/ff1/__init__.py +++ b/worlds/ff1/__init__.py @@ -54,6 +54,7 @@ class FF1World(World): locations = get_options(self.world, 'locations', self.player) rules = get_options(self.world, 'rules', self.player) menu_region = self.ff1_locations.create_menu_region(self.player, locations, rules) + menu_region.world = self.world terminated_event = Location(self.player, CHAOS_TERMINATED_EVENT, EventId, menu_region) terminated_item = Item(CHAOS_TERMINATED_EVENT, ItemClassification.progression, EventId, self.player) terminated_event.place_locked_item(terminated_item)