diff --git a/src/otclient/game.cpp b/src/otclient/game.cpp index 08294382..e432fdfc 100644 --- a/src/otclient/game.cpp +++ b/src/otclient/game.cpp @@ -481,10 +481,9 @@ void Game::walk(Otc::Direction direction) Position pos = toPos; if(!pos.down()) return false; - toTile = g_map.getTile(pos); - if(toTile && toTile->hasElevation(3)) { + TilePtr toTile = g_map.getTile(pos); + if(toTile && toTile->hasElevation(3)) return true; - } return false; }; @@ -496,13 +495,14 @@ void Game::walk(Otc::Direction direction) Position pos = toPos; if(!pos.up()) return false; - toTile = g_map.getTile(pos); + TilePtr toTile = g_map.getTile(pos); if(!toTile || !toTile->isWalkable()) return false; return true; }; - if(canChangeFloorDown() || canChangeFloorUp()) { + if(canChangeFloorDown() || canChangeFloorUp() || + (!toTile || toTile->isEmpty())) { m_localPlayer->lockWalk(); } else return; diff --git a/src/otclient/mapview.cpp b/src/otclient/mapview.cpp index da1017c7..91dd0d01 100644 --- a/src/otclient/mapview.cpp +++ b/src/otclient/mapview.cpp @@ -312,7 +312,7 @@ void MapView::updateVisibleTilesCache(int start) tilePos.coveredUp(cameraPosition.z - iz); if(const TilePtr& tile = g_map.getTile(tilePos)) { // skip tiles that have nothing - if(tile->isEmpty()) + if(!tile->isDrawable()) continue; // skip tiles that are completely behind another tile if(g_map.isCompletelyCovered(tilePos, m_cachedFirstVisibleFloor)) @@ -366,7 +366,7 @@ void MapView::updateVisibleTilesCache(int start) Position tilePos = cameraPosition.translated(p.x - m_virtualCenterOffset.x, p.y - m_virtualCenterOffset.y); tilePos.coveredUp(cameraPosition.z - iz); if(const TilePtr& tile = g_map.getTile(tilePos)) { - if(!tile->isEmpty()) + if(tile->isDrawable()) m_cachedVisibleTiles.push_back(tile); } } diff --git a/src/otclient/protocolgame.cpp b/src/otclient/protocolgame.cpp index 417e9849..00cb3cf8 100644 --- a/src/otclient/protocolgame.cpp +++ b/src/otclient/protocolgame.cpp @@ -60,10 +60,13 @@ void ProtocolGame::onRecv(const InputMessagePtr& inputMessage) { if(m_firstRecv) { m_firstRecv = false; - int size = inputMessage->getU16(); - if(size != inputMessage->getUnreadSize()) { - g_logger.traceError("invalid message size"); - return; + + if(g_game.getClientVersion() > 810) { + int size = inputMessage->getU16(); + if(size != inputMessage->getUnreadSize()) { + g_logger.traceError("invalid message size"); + return; + } } } diff --git a/src/otclient/tile.cpp b/src/otclient/tile.cpp index 997206a2..abb8dbab 100644 --- a/src/otclient/tile.cpp +++ b/src/otclient/tile.cpp @@ -504,6 +504,11 @@ bool Tile::isEmpty() return m_things.size() == 0; } +bool Tile::isDrawable() +{ + return !m_things.empty() || !m_walkingCreatures.empty() || !m_effects.empty(); +} + bool Tile::mustHookEast() { for(const ThingPtr& thing : m_things) diff --git a/src/otclient/tile.h b/src/otclient/tile.h index c2246932..ee836e6b 100644 --- a/src/otclient/tile.h +++ b/src/otclient/tile.h @@ -98,6 +98,7 @@ public: bool isLookPossible(); bool isClickable(); bool isEmpty(); + bool isDrawable(); bool mustHookSouth(); bool mustHookEast(); bool hasCreature();