print("Can't tokenize command string: " + str(err) + ".")
return
if len(tokens) > 0 and tokens[0] in commands_db \
- and len(tokens) >= commands_db[tokens[0]][0] + 1:
+ and len(tokens) == commands_db[tokens[0]][0] + 1:
if commands_db[tokens[0]][1]:
commands_db[tokens[0]][2]()
elif replay:
io_db["file_record"] = open(io_db["path_record"], "r")
io_db["file_record"].prefix = "record file line "
io_db["file_record"].line_n = 1
- while world_db["turn"] < opts.replay:
+ while world_db["TURN"] < opts.replay:
line = io_db["file_record"].readline()
if "" == line:
break
def command_turn(turn_string):
"""Set turn to what's described in turn_string."""
+ min = 0
+ max = 65535
try:
turn = int(turn_string)
- min = 0
- max = 65535
if turn < min or turn > max:
raise ValueError
world_db["TURN"] = turn
def command_makeworld(seed_string):
# Mere dummy so far.
+ min = 0
+ max = 4294967295
try:
seed = int(seed_string)
- min = 0
- max = 4294967295
if seed < min or seed > max:
raise ValueError
world_db["SEED_RANDOMNESS"] = seed