Zillion: more rooms added to map_gen option (#3634)

This commit is contained in:
Doug Hoskisson
2024-07-10 23:11:47 -07:00
committed by GitHub
parent 8c86139066
commit 1e3a4b6db5
3 changed files with 13 additions and 1 deletions

View File

@@ -28,6 +28,13 @@ class GenData:
def from_json(gen_data_str: str) -> "GenData":
""" the reverse of `to_json` """
from_json = json.loads(gen_data_str)
# backwards compatibility for seeds generated before new map_gen options
room_gen = from_json["zz_game"]["options"].get("room_gen", None)
if room_gen is not None:
from_json["zz_game"]["options"]["map_gen"] = {False: "none", True: "rooms"}.get(room_gen, "none")
del from_json["zz_game"]["options"]["room_gen"]
return GenData(
from_json["multi_items"],
ZzGame.from_jsonable(from_json["zz_game"]),