From 2292df922d4a77de90802209f0b06423cc4b2699 Mon Sep 17 00:00:00 2001 From: Joao Pasqualini Costa Date: Thu, 2 Feb 2017 05:59:20 -0200 Subject: [PATCH] Fix Look (#818) sendLookCreature should only be called in battleList --- modules/game_battle/battle.lua | 4 ++-- src/client/game.cpp | 4 ++-- src/client/game.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/game_battle/battle.lua b/modules/game_battle/battle.lua index 69c11ca8..17933306 100644 --- a/modules/game_battle/battle.lua +++ b/modules/game_battle/battle.lua @@ -484,10 +484,10 @@ function onBattleButtonMouseRelease(self, mousePosition, mouseButton) if ((g_mouse.isPressed(MouseLeftButton) and mouseButton == MouseRightButton) or (g_mouse.isPressed(MouseRightButton) and mouseButton == MouseLeftButton)) then mouseWidget.cancelNextRelease = true - g_game.look(self.creature) + g_game.look(self.creature, true) return true elseif mouseButton == MouseLeftButton and g_keyboard.isShiftPressed() then - g_game.look(self.creature) + g_game.look(self.creature, true) return true elseif mouseButton == MouseRightButton and not g_mouse.isPressed(MouseLeftButton) then modules.game_interface.createThingMenu(mousePosition, nil, nil, self.creature) diff --git a/src/client/game.cpp b/src/client/game.cpp index c2170ea8..80b0b49b 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -778,12 +778,12 @@ void Game::stop() m_protocolGame->sendStop(); } -void Game::look(const ThingPtr& thing) +void Game::look(const ThingPtr& thing, bool isBattleList) { if(!canPerformGameAction() || !thing) return; - if(thing->isCreature() && m_protocolVersion >= 961) + if(thing->isCreature() && isBattleList && m_protocolVersion >= 961) m_protocolGame->sendLookCreature(thing->getId()); else m_protocolGame->sendLook(thing->getPosition(), thing->getId(), thing->getStackPos()); diff --git a/src/client/game.h b/src/client/game.h index 1f6cbe67..53b8314f 100644 --- a/src/client/game.h +++ b/src/client/game.h @@ -173,7 +173,7 @@ public: void stop(); // item related - void look(const ThingPtr& thing); + void look(const ThingPtr& thing, bool isBattleList = false); void move(const ThingPtr &thing, const Position& toPos, int count); void moveToParentContainer(const ThingPtr& thing, int count); void rotate(const ThingPtr& thing);