Skip to content

Commit

Permalink
Merge pull request #25 from y0lo/bugxif/y0lo/clear-input-event-queue-…
Browse files Browse the repository at this point in the history
…on-end-combat-turn

Clear input envents on combat turn
  • Loading branch information
roginvs authored Nov 14, 2024
2 parents 19becd8 + 2d88189 commit 3e35f2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/combat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3233,6 +3233,7 @@ static int _combat_turn(Object* obj, bool a2)
} else {
if (obj == gDude) {
keyboardReset();
inputEventQueueReset();
interfaceRenderArmorClass(true);
_combat_free_move = 2 * perkGetRank(gDude, PERK_BONUS_MOVE);
interfaceRenderActionPoints(gDude->data.critter.combat.ap, _combat_free_move);
Expand Down
2 changes: 2 additions & 0 deletions src/input.cc
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ void inputEventQueueReset()
{
gInputEventQueueReadIndex = -1;
gInputEventQueueWriteIndex = 0;
SDL_Event e;
while (SDL_PollEvent(&e)) {} // Clear all input events
}

// 0x4C8D1C
Expand Down

0 comments on commit 3e35f2c

Please sign in to comment.