From 6c6b8104326941c4bd6c1f1d542e8969d82e97d8 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Mon, 3 Nov 2008 02:20:25 +0000 Subject: Fixed talk being recalled while t is held down. Thanks doors for noticing this bug. --- src/game.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src/game.cpp') diff --git a/src/game.cpp b/src/game.cpp index d7ce4314..10a66ce1 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -863,17 +863,20 @@ void Game::handleInput() // Talk to the nearest NPC if 't' pressed if ( keyboard.isKeyActive(keyboard.KEY_TALK) ) { - Being *target = player_node->getTarget(); - - if (!target) + if (!npcTextDialog->isVisible() && !npcListDialog->isVisible()) { - target = beingManager->findNearestLivingBeing(x, y, 20, Being::NPC); - } + Being *target = player_node->getTarget(); - if (target) - { - if (target->getType() == Being::NPC) - dynamic_cast(target)->talk(); + if (!target) + { + target = beingManager->findNearestLivingBeing(x, y, 20, Being::NPC); + } + + if (target) + { + if (target->getType() == Being::NPC) + dynamic_cast(target)->talk(); + } } } -- cgit v1.2.3-70-g09d2