We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e36561d + a2b0bfa commit 379613dCopy full SHA for 379613d
src/core/game/levelThunks.ts
@@ -144,12 +144,18 @@ export const loadLevel =
144
const shipScreenX = SCRWTH / 2
145
const shipScreenY = Math.floor((TOPMARG + BOTMARG) / 2)
146
147
+ // Check if ship was dead before loading new level
148
+ // If so, we need to reset fuel (fixes bug where dying at end of level doesn't reset fuel)
149
+ state = _getState()
150
+ const wasShipDead = state.ship.deadCount > 0
151
+
152
dispatch(
153
shipSlice.actions.initShip({
154
x: shipScreenX,
155
y: shipScreenY,
156
globalx: planet.xstart,
- globaly: planet.ystart
157
+ globaly: planet.ystart,
158
+ resetFuel: wasShipDead // Reset fuel if ship was dead during level transition
159
})
160
)
161
0 commit comments