Skip to content

Commit

Permalink
Merge pull request #1244 from lairworks/callEventHandlerPumpFirst
Browse files Browse the repository at this point in the history
Call `EventHandler::pump()` first in game loop
  • Loading branch information
DanRStevens authored Feb 26, 2025
2 parents 0b1af07 + 5efbb46 commit 5ca9373
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions NAS2D/StateManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ void StateManager::setState(State* state)
*/
bool StateManager::update()
{
Utility<EventHandler>::get().pump();

if (mActiveState)
{
State* nextState = mActiveState->update();
Expand All @@ -80,8 +82,6 @@ bool StateManager::update()
{
setState(nextState);
}

Utility<EventHandler>::get().pump();
}
else
{
Expand Down

0 comments on commit 5ca9373

Please sign in to comment.