From 39c9be9c2d5b911fbd6cdc73eb9ef50140859a06 Mon Sep 17 00:00:00 2001 From: Ricardo Mendes Date: Sat, 27 Aug 2022 02:34:02 +0100 Subject: [PATCH] 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. --- src/game.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/game.h b/src/game.h index 4c4c60d..a8a8f5e 100644 --- a/src/game.h +++ b/src/game.h @@ -217,7 +217,9 @@ namespace Game { } } - if (!level->level.isTitle()) { + // Only check for cStart if the inventory is not active. + // Otherwise if cStart was binded to item selection key in inventory it would reset the player. + if (!level->level.isTitle() && !inventory->isActive()) { if (Input::lastState[0] == cStart) level->addPlayer(0); if (Input::lastState[1] == cStart) level->addPlayer(1); }