Commit a54e3d7
fix: commit refilled energy back to player state
Greptile caught this on review: the refill-tick loop computed incremented
energy/lastLogin into local variables but never wrote them back to
playerState, so the displayed energy counter stayed stale between real
account-change notifications. The previous BN-based version got away with
mutating playerState.energy in place and relying on the same effects
setTimePassed/setEnergyNextIn calls to force a re-render - that trick got
dropped when the local let variables were introduced. Now commits the
computed values via setPlayerState explicitly, only when something changed.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent 3b78467 commit a54e3d7
1 file changed
Lines changed: 6 additions & 0 deletions
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
111 | 112 | | |
112 | 113 | | |
| 114 | + | |
113 | 115 | | |
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
118 | 120 | | |
119 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
120 | 126 | | |
121 | 127 | | |
122 | 128 | | |
| |||
0 commit comments