diff --git a/src/client/mapview.cpp b/src/client/mapview.cpp index 46a7ef269..f40168929 100644 --- a/src/client/mapview.cpp +++ b/src/client/mapview.cpp @@ -353,7 +353,7 @@ void MapView::updateVisibleTiles() m_updateVisibleTiles = false; m_resetCoveredCache = false; - updateHighlightTile(); + updateHighlightTile(m_mousePosition); } void MapView::updateRect(const Rect& rect) { @@ -475,7 +475,7 @@ void MapView::onMouseMove(const Position& mousePos, const bool /*isVirtualMove*/ { { // Highlight Target System destroyHighlightTile(); - updateHighlightTile(); + updateHighlightTile(mousePos); } } @@ -849,9 +849,9 @@ void MapView::setCrosshairTexture(const std::string& texturePath) m_crosshairTexture = texturePath.empty() ? nullptr : g_textures.getTexture(texturePath); } -void MapView::updateHighlightTile() { +void MapView::updateHighlightTile(const Position& mousePos) { if (m_drawHighlightTarget) { - if ((m_lastHighlightTile = (m_shiftPressed ? getTopTile(m_mousePosition) : g_map.getTile(m_mousePosition)))) + if ((m_lastHighlightTile = (m_shiftPressed ? getTopTile(mousePos) : g_map.getTile(mousePos)))) m_lastHighlightTile->select(m_shiftPressed ? TileSelectType::NO_FILTERED : TileSelectType::FILTERED); } } diff --git a/src/client/mapview.h b/src/client/mapview.h index 06f87bfab..02a29c6f7 100644 --- a/src/client/mapview.h +++ b/src/client/mapview.h @@ -233,7 +233,7 @@ class MapView : public LuaObject void updateViewportDirectionCache(); void drawFloor(); - void updateHighlightTile(); + void updateHighlightTile(const Position& mousePos); void destroyHighlightTile(); void updateViewport(const Otc::Direction dir = Otc::InvalidDirection) { m_viewport = m_viewPortDirection[dir]; }