diff --git a/main.py b/main.py index dc459f0..4b92d47 100644 --- a/main.py +++ b/main.py @@ -266,11 +266,14 @@ if __name__ == "__main__": # Subkey CHARACTERS commands with COMMANDS data # This turns lists of commands each character has into hashes where # Command name => Textual desc of command - for character, c_data in data["CHARACTERS"].items(): - new_commands = {} - for command in c_data["commands"]: - new_commands[command] = data["COMMANDS"].get(command, command) - c_data["commands"] = new_commands + # Certain flags don't shuffle commands like this so we have to check + if "COMMANDS" in data: + for character, c_data in data["CHARACTERS"].items(): + new_commands = {} + + for command in c_data["commands"]: + new_commands[command] = data["COMMANDS"].get(command, command) + c_data["commands"] = new_commands # If we have a STATS block, snap it into CHARACTER data # BCCE broke this out into its own section