Skip to content

Commit

Permalink
fix(worlds): 🐛 Fixed a bug where it wouldn't stop 'loading' if it fin…
Browse files Browse the repository at this point in the history
…ished all the loading and hadn't completed all the tasks it said there were
  • Loading branch information
Tsunami014 committed Feb 10, 2024
1 parent 5964a4d commit ca77772
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion __main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def edit(_):
if element == 0: # back
return False
elif element == 1: # make new world
NumOTasks = 21 + 5 + 1 # 21 from terrainGen.py, 5 from world.py
NumOTasks = 21 + 5 # 21 from terrainGen.py, 5 from world.py
dones = [False for _ in range(NumOTasks)]
done = [False]
async def wait(i):
Expand All @@ -145,6 +145,7 @@ def CB(txt):
while G.Container.pbar == None:
pass
done[0] = World('newworld', 'New World', 'a new world', 10, 100, callback=CB)
for i in range(len(dones)): dones[i] = True
t = Thread(target=NW, daemon=True, args=(dones, done))
tasks = [wait(i) for i in range(NumOTasks)]
G.Container.pbar = None
Expand Down

0 comments on commit ca77772

Please sign in to comment.