Skip to content

Commit

Permalink
set name dict before loop so we don't have to check for its existence…
Browse files Browse the repository at this point in the history
… later
  • Loading branch information
qwint committed Sep 8, 2024
1 parent e384736 commit 226d34e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ def main(args=None) -> Tuple[argparse.Namespace, int]:
erargs.player_options = {}

player = 1
erargs.name = {}
while player <= args.multi:
path = player_path_cache[player]
if path:
Expand All @@ -200,8 +201,6 @@ def main(args=None) -> Tuple[argparse.Namespace, int]:
except Exception as e:
raise Exception(f"Error setting {k} to {v} for player {player}") from e

if not getattr(erargs, "name", None):
setattr(erargs, "name", {}) # if the first slot does not define a name we won't have a name obj to look up
if path == args.weights_file_path: # if name came from the weights file, just use base player name
erargs.name[player] = f"Player{player}"
elif player not in erargs.name: # if name was not specified, generate it from filename
Expand Down

0 comments on commit 226d34e

Please sign in to comment.