Add browser-playable prototype for Factory Launch#1
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ 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".
| addFuelToMachine(machine, amount) { | ||
| if (this.takeFromPlayer("coal", amount) < amount) { | ||
| this.addLog("Not enough coal to fuel the machine."); | ||
| return false; |
There was a problem hiding this comment.
Avoid consuming coal when refuel request fails
addFuelToMachine removes coal from the player before verifying that the full amount is available. If the player clicks “Refuel with 10 Coal” while holding only 3, those 3 units are taken from inventory, the call returns false, and the machine receives nothing. This silently burns scarce resources. Consider checking availability (or rolling back the withdrawal) before mutating inventory so a failed refuel leaves the player’s coal untouched.
Useful? React with 👍 / 👎.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68ff98ba34c4832e85873e98d38d6ef0