Skip to content

Commit db1131e

Browse files
committed
Fix nil pointer panic when InputInterface is never selected
NewGameState now initialises InputInterface to the always-enabled composite (arrow keys + keyboard + gamepad) so it is never nil. Previously, timing out the control selection screen left InputInterface nil, causing a panic in updateScrollIn once scroll-in completed and the game began polling for player input.
1 parent 5ce25c6 commit db1131e

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

pkg/state/state.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ func NewGameState() *GameState {
8888
{Lives: domain.LivesInitial},
8989
{Lives: domain.LivesInitial},
9090
},
91+
InputInterface: input.InterfaceFor(0),
9192
}
9293
}
9394

0 commit comments

Comments
 (0)