- if not os.access(io_db["path_worldconf"], os.F_OK):
- msg = "No world config file from which to start a new world."
- raise SystemExit(msg)
- file = open(io_db["path_worldconf"])
- line_n = 1
- for line in file.readlines():
- obey(line.rstrip(), io_db, "worldconfig file line " + str(line_n))
- line_n = line_n + 1
- file.close()
- obey("MAKE_WORLD " + str(int(time.time())), io_db, "in file")
+ if os.access(io_db["path_save"], os.F_OK):
+ obey_lines_in_file(io_db["path_save"], "save")
+ else:
+ if not os.access(io_db["path_worldconf"], os.F_OK):
+ msg = "No world config file from which to start a new world."
+ raise SystemExit(msg)
+ obey_lines_in_file(io_db["path_worldconf"], "world config ")
+ obey("MAKE_WORLD " + str(int(time.time())), io_db, "in file")
+ # print("DUMMY: Run io_loop().")