From c9eaa73df54af3095ac8167bd22bb35f4d8c023a Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Wed, 1 Aug 2012 22:47:55 -0300 Subject: [PATCH] Improve clicking on walking creatures --- modules/game_interface/gameinterface.lua | 4 ++-- src/otclient/game.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/game_interface/gameinterface.lua b/modules/game_interface/gameinterface.lua index 755217ec..fa791b4d 100644 --- a/modules/game_interface/gameinterface.lua +++ b/modules/game_interface/gameinterface.lua @@ -394,8 +394,8 @@ function processMouseAction(menuPosition, mouseButton, autoWalkPos, lookThing, u else if multiUseThing and keyboardModifiers == KeyboardNoModifier and mouseButton == MouseRightButton and not g_mouse.isPressed(MouseLeftButton) then local player = g_game.getLocalPlayer() - if multiUseThing:isCreature() and multiUseThing:isCreature() ~= player then - g_game.attack(multiUseThing) + if creatureThing ~= player then + g_game.attack(creatureThing) return true elseif multiUseThing:isContainer() then if multiUseThing:getParentContainer() then diff --git a/src/otclient/game.cpp b/src/otclient/game.cpp index ea915365..ee5e3343 100644 --- a/src/otclient/game.cpp +++ b/src/otclient/game.cpp @@ -769,7 +769,7 @@ void Game::attack(const CreaturePtr& creature) if(!canPerformGameAction() || creature == m_localPlayer) return; - if(creature == m_attackingCreature) { + if(creature && creature == m_attackingCreature) { cancelAttack(); return; }