summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2008-11-03 02:20:25 +0000
committerIra Rice <irarice@gmail.com>2008-11-03 02:20:25 +0000
commit6c6b8104326941c4bd6c1f1d542e8969d82e97d8 (patch)
tree37b51100f967cb8f6a5bbee522ca24ce2587c820 /src/game.cpp
parent25cda302161fe6be6f70a6228b8f40467c77929e (diff)
downloadmana-client-6c6b8104326941c4bd6c1f1d542e8969d82e97d8.tar.gz
mana-client-6c6b8104326941c4bd6c1f1d542e8969d82e97d8.tar.bz2
mana-client-6c6b8104326941c4bd6c1f1d542e8969d82e97d8.tar.xz
mana-client-6c6b8104326941c4bd6c1f1d542e8969d82e97d8.zip
Fixed talk being recalled while t is held down. Thanks doors for
noticing this bug.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp21
1 files changed, 12 insertions, 9 deletions
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<NPC*>(target)->talk();
+ if (!target)
+ {
+ target = beingManager->findNearestLivingBeing(x, y, 20, Being::NPC);
+ }
+
+ if (target)
+ {
+ if (target->getType() == Being::NPC)
+ dynamic_cast<NPC*>(target)->talk();
+ }
}
}