fixed key binding
This commit is contained in:
@ -797,6 +797,11 @@ int main(int, char **)
|
||||
else {
|
||||
// Route event to state manager handlers for per-state logic
|
||||
stateMgr.handleEvent(e);
|
||||
// Keep the local `state` variable in sync with StateManager in case
|
||||
// a state handler requested a transition (handlers may call
|
||||
// stateMgr.setState()). Many branches below rely on the local
|
||||
// `state` variable, so update it immediately after handling.
|
||||
state = stateMgr.getState();
|
||||
|
||||
// Global key toggles (applies regardless of state)
|
||||
if (e.type == SDL_EVENT_KEY_DOWN && !e.key.repeat) {
|
||||
|
||||
Reference in New Issue
Block a user