Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba15a866f2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| self.day = int(data["day"]) | ||
| self.player = list(data["player"]) | ||
| self.resources = ResourceState(**data["resources"]) | ||
| self.machines = [Machine(**m) for m in data["machines"]] | ||
| self.genome.features = [FeatureGene(**f) for f in data["features"]] |
There was a problem hiding this comment.
Handle malformed save schemas in load_game
load_game() advertises a boolean failure path, but it only catches JSONDecodeError and then directly indexes data["day"], data["player"], etc. Any valid JSON file with missing or wrong-typed fields (for example, a partially written save or an older schema) raises KeyError/TypeError and crashes the caller instead of returning False; in the UI path this will terminate the game when the user presses load.
Useful? React with 👍 / 👎.
No description provided.