mirror of
				https://github.com/MarioSpore/Grinch-AP.git
				synced 2025-10-21 20:21:32 -06:00 
			
		
		
		
	Core: change Region caching to on_change from on-miss-strategy (#2366)
This commit is contained in:
		| @@ -329,23 +329,22 @@ class ZillionWorld(World): | ||||
|         empty = zz_items[4] | ||||
|         multi_item = empty  # a different patcher method differentiates empty from ap multi item | ||||
|         multi_items: Dict[str, Tuple[str, str]] = {}  # zz_loc_name to (item_name, player_name) | ||||
|         for loc in self.multiworld.get_locations(): | ||||
|             if loc.player == self.player: | ||||
|                 z_loc = cast(ZillionLocation, loc) | ||||
|                 # debug_zz_loc_ids[z_loc.zz_loc.name] = id(z_loc.zz_loc) | ||||
|                 if z_loc.item is None: | ||||
|                     self.logger.warn("generate_output location has no item - is that ok?") | ||||
|                     z_loc.zz_loc.item = empty | ||||
|                 elif z_loc.item.player == self.player: | ||||
|                     z_item = cast(ZillionItem, z_loc.item) | ||||
|                     z_loc.zz_loc.item = z_item.zz_item | ||||
|                 else:  # another player's item | ||||
|                     # print(f"put multi item in {z_loc.zz_loc.name}") | ||||
|                     z_loc.zz_loc.item = multi_item | ||||
|                     multi_items[z_loc.zz_loc.name] = ( | ||||
|                         z_loc.item.name, | ||||
|                         self.multiworld.get_player_name(z_loc.item.player) | ||||
|                     ) | ||||
|         for loc in self.multiworld.get_locations(self.player): | ||||
|             z_loc = cast(ZillionLocation, loc) | ||||
|             # debug_zz_loc_ids[z_loc.zz_loc.name] = id(z_loc.zz_loc) | ||||
|             if z_loc.item is None: | ||||
|                 self.logger.warn("generate_output location has no item - is that ok?") | ||||
|                 z_loc.zz_loc.item = empty | ||||
|             elif z_loc.item.player == self.player: | ||||
|                 z_item = cast(ZillionItem, z_loc.item) | ||||
|                 z_loc.zz_loc.item = z_item.zz_item | ||||
|             else:  # another player's item | ||||
|                 # print(f"put multi item in {z_loc.zz_loc.name}") | ||||
|                 z_loc.zz_loc.item = multi_item | ||||
|                 multi_items[z_loc.zz_loc.name] = ( | ||||
|                     z_loc.item.name, | ||||
|                     self.multiworld.get_player_name(z_loc.item.player) | ||||
|                 ) | ||||
|         # debug_zz_loc_ids.sort() | ||||
|         # for name, id_ in debug_zz_loc_ids.items(): | ||||
|         #     print(id_) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Fabian Dill
					Fabian Dill