diff options
Diffstat (limited to 'src/player.c')
| -rw-r--r-- | src/player.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/player.c b/src/player.c index c3e9119..df59ffe 100644 --- a/src/player.c +++ b/src/player.c @@ -1,6 +1,7 @@ #include "player.h" #include "game.h" #include "settings.h" +#include "ui.h" Player createPlayer() { @@ -408,13 +409,27 @@ void playerUpdateSelectedEntity(Player* player, WorldUID uid, Game* game) { playerInteractWithEntity(player, uid, game, SELECTION_INTERACT); } - else if (IsKeyPressed(game->settings.leaveKey)) + + // Actions that should only be done while interacting. + if (!player->isInteracting) + { + return; + } + + if (IsKeyPressed(game->settings.leaveKey)) { playerInteractWithEntity(player, uid, game, SELECTION_LEAVE); } else if (IsKeyPressed(game->settings.nextMessageKey)) { - playerInteractWithEntity(player, uid, game, SELECTION_NEXT_MESSAGE); + if (isInteractionChatAnimationDone(chat)) + { + playerInteractWithEntity(player, uid, game, SELECTION_NEXT_MESSAGE); + } + else + { + endInteractionChatAnimation(chat); + } } else if (keyPressed >= KEY_ONE && keyPressed <= KEY_NINE) { |
