Hollow Knight: Clean outdated slot data code and comments #3988
This commit is contained in:
		| @@ -534,26 +534,16 @@ class HKWorld(World): | ||||
|         for option_name in hollow_knight_options: | ||||
|             option = getattr(self.options, option_name) | ||||
|             try: | ||||
|                 # exclude more complex types - we only care about int, bool, enum for player options; the client | ||||
|                 # can get them back to the necessary type. | ||||
|                 optionvalue = int(option.value) | ||||
|             except TypeError: | ||||
|                 pass  # C# side is currently typed as dict[str, int], drop what doesn't fit | ||||
|             else: | ||||
|                 options[option_name] = optionvalue | ||||
|             except TypeError: | ||||
|                 pass | ||||
|  | ||||
|         # 32 bit int | ||||
|         slot_data["seed"] = self.random.randint(-2147483647, 2147483646) | ||||
|  | ||||
|         # Backwards compatibility for shop cost data (HKAP < 0.1.0) | ||||
|         if not self.options.CostSanity: | ||||
|             for shop, terms in shop_cost_types.items(): | ||||
|                 unit = cost_terms[next(iter(terms))].option | ||||
|                 if unit == "Geo": | ||||
|                     continue | ||||
|                 slot_data[f"{unit}_costs"] = { | ||||
|                     loc.name: next(iter(loc.costs.values())) | ||||
|                     for loc in self.created_multi_locations[shop] | ||||
|                 } | ||||
|  | ||||
|         # HKAP 0.1.0 and later cost data. | ||||
|         location_costs = {} | ||||
|         for region in self.multiworld.get_regions(self.player): | ||||
| @@ -566,7 +556,7 @@ class HKWorld(World): | ||||
|  | ||||
|         slot_data["grub_count"] = self.grub_count | ||||
|  | ||||
|         slot_data["is_race"] = int(self.settings.disable_spoilers or self.multiworld.is_race) | ||||
|         slot_data["is_race"] = self.settings.disable_spoilers or self.multiworld.is_race | ||||
|  | ||||
|         return slot_data | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 BadMagic100
					BadMagic100