Improve clicking on walking creatures
This commit is contained in:
parent
daea7cab65
commit
c9eaa73df5
|
@ -394,8 +394,8 @@ function processMouseAction(menuPosition, mouseButton, autoWalkPos, lookThing, u
|
||||||
else
|
else
|
||||||
if multiUseThing and keyboardModifiers == KeyboardNoModifier and mouseButton == MouseRightButton and not g_mouse.isPressed(MouseLeftButton) then
|
if multiUseThing and keyboardModifiers == KeyboardNoModifier and mouseButton == MouseRightButton and not g_mouse.isPressed(MouseLeftButton) then
|
||||||
local player = g_game.getLocalPlayer()
|
local player = g_game.getLocalPlayer()
|
||||||
if multiUseThing:isCreature() and multiUseThing:isCreature() ~= player then
|
if creatureThing ~= player then
|
||||||
g_game.attack(multiUseThing)
|
g_game.attack(creatureThing)
|
||||||
return true
|
return true
|
||||||
elseif multiUseThing:isContainer() then
|
elseif multiUseThing:isContainer() then
|
||||||
if multiUseThing:getParentContainer() then
|
if multiUseThing:getParentContainer() then
|
||||||
|
|
|
@ -769,7 +769,7 @@ void Game::attack(const CreaturePtr& creature)
|
||||||
if(!canPerformGameAction() || creature == m_localPlayer)
|
if(!canPerformGameAction() || creature == m_localPlayer)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(creature == m_attackingCreature) {
|
if(creature && creature == m_attackingCreature) {
|
||||||
cancelAttack();
|
cancelAttack();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue