Skip to content

Commit a93e718

Browse files
committed
Bump count instead of assigning just that one id
1 parent 2e48c65 commit a93e718

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/Items.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
if "id" in item_table[key]:
2929
item_id = item_table[key]["id"]
3030
if item_id > count:
31-
item_table[key]["id"] = item_id
31+
count = item_id
3232
else:
3333
raise ValueError(f"{item_table[key]['name']} has an invalid ID. ID must be at least {count + 1}")
34-
else:
35-
item_table[key]["id"] = count
34+
35+
item_table[key]["id"] = count
3636
item_table[key]["progression"] = val["progression"] if "progression" in val else False
3737
count += 1
3838

src/Locations.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@
2020
if "id" in location_table[key]:
2121
item_id = location_table[key]["id"]
2222
if item_id > count:
23-
location_table[key]["id"] = item_id
23+
count = item_id
2424
else:
2525
raise ValueError(f"{location_table[key]['name']} has an invalid ID. ID must be at least {count + 1}")
26-
else:
27-
location_table[key]["id"] = count
2826

27+
location_table[key]["id"] = count
2928

3029
if not "region" in location_table[key]:
3130
location_table[key]["region"] = "Manual" # all locations are in the same region for Manual

0 commit comments

Comments
 (0)