The Messenger: speed up generation for large multiworlds (#2359)
This commit is contained in:
		
							parent
							
								
									e5554f8630
								
							
						
					
					
						commit
						be959c05a6
					
				|  | @ -82,9 +82,7 @@ class MessengerWorld(World): | |||
|         self.shop_prices, self.figurine_prices = shuffle_shop_prices(self) | ||||
| 
 | ||||
|     def create_regions(self) -> None: | ||||
|         for region in [MessengerRegion(reg_name, self) for reg_name in REGIONS]: | ||||
|             if region.name in REGION_CONNECTIONS: | ||||
|                 region.add_exits(REGION_CONNECTIONS[region.name]) | ||||
|         self.multiworld.regions += [MessengerRegion(reg_name, self) for reg_name in REGIONS] | ||||
| 
 | ||||
|     def create_items(self) -> None: | ||||
|         # create items that are always in the item pool | ||||
|  | @ -138,6 +136,8 @@ class MessengerWorld(World): | |||
|         self.multiworld.itempool += itempool | ||||
| 
 | ||||
|     def set_rules(self) -> None: | ||||
|         for reg_name, connections in REGION_CONNECTIONS.items(): | ||||
|             self.multiworld.get_region(reg_name, self.player).add_exits(connections) | ||||
|         logic = self.options.logic_level | ||||
|         if logic == Logic.option_normal: | ||||
|             MessengerRules(self).set_messenger_rules() | ||||
|  |  | |||
|  | @ -32,7 +32,6 @@ class MessengerRegion(Region): | |||
|         loc_dict = {loc: world.location_name_to_id[loc] if loc in world.location_name_to_id else None | ||||
|                     for loc in locations} | ||||
|         self.add_locations(loc_dict, MessengerLocation) | ||||
|         world.multiworld.regions.append(self) | ||||
| 
 | ||||
| 
 | ||||
| class MessengerLocation(Location): | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue