Skip to content

Commit 27cf7b4

Browse files
committed
Update events migration tool
1 parent a70005e commit 27cf7b4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

other/migrate_v4_events_to_v5.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@
3838
else:
3939
newName = "end"
4040
newEventJson["possibilities"][newName] = {}
41+
newEventJson["possibilities"][newName]["outcomes"] = {}
42+
if "condition" in jsonObj["possibilities"][possibilityKey]:
43+
newEventJson["possibilities"][newName]["condition"] = jsonObj["possibilities"][possibilityKey]["condition"]
4144
for i in range(0, len(jsonObj["possibilities"][possibilityKey]["outcomes"])):
42-
newEventJson["possibilities"][newName][str(i)] = jsonObj["possibilities"][possibilityKey]["outcomes"][i]
43-
del newEventJson["possibilities"][newName][str(i)]["translations"]
45+
newEventJson["possibilities"][newName]["outcomes"][str(i)] = jsonObj["possibilities"][possibilityKey]["outcomes"][i]
46+
del newEventJson["possibilities"][newName]["outcomes"][str(i)]["translations"]
4447

4548
with open(os.path.join(outputDir, filename), "w") as outputFh:
4649
outputFh.write(json.dumps(newEventJson, ensure_ascii=False, indent=4, sort_keys=True))

0 commit comments

Comments
 (0)