Skip to content

Fix sim edge cases and optimize machine processing#3

Open
oFOXo wants to merge 1 commit intomainfrom
codex/create-solarpunk-survival-game-with-python-bu9059
Open

Fix sim edge cases and optimize machine processing#3
oFOXo wants to merge 1 commit intomainfrom
codex/create-solarpunk-survival-game-with-python-bu9059

Conversation

@oFOXo
Copy link
Copy Markdown
Owner

@oFOXo oFOXo commented May 2, 2026

No description provided.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread scifarm/sim.py
Comment on lines +146 to +150
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"]]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant