Skip to content

Commit 39c9be9

Browse files
authored
Avoids creating the player if inventory open. (#442)
Otherwise if cStart was binded to an item selection key in inventory it would reset the player.
1 parent 7d94f12 commit 39c9be9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/game.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,9 @@ namespace Game {
217217
}
218218
}
219219

220-
if (!level->level.isTitle()) {
220+
// Only check for cStart if the inventory is not active.
221+
// Otherwise if cStart was binded to item selection key in inventory it would reset the player.
222+
if (!level->level.isTitle() && !inventory->isActive()) {
221223
if (Input::lastState[0] == cStart) level->addPlayer(0);
222224
if (Input::lastState[1] == cStart) level->addPlayer(1);
223225
}

0 commit comments

Comments
 (0)