diff --git a/src/otclient/core/map.cpp b/src/otclient/core/map.cpp index f1a5e747..2f21c6ff 100644 --- a/src/otclient/core/map.cpp +++ b/src/otclient/core/map.cpp @@ -155,7 +155,6 @@ void Map::removeThingByPtr(ThingPtr thing) void Map::clean() { m_tiles.clear(); - m_creatures.clear(); } void Map::cleanTile(const Position& pos) diff --git a/src/otclient/core/tile.cpp b/src/otclient/core/tile.cpp index 7080e5ae..78d74ce7 100644 --- a/src/otclient/core/tile.cpp +++ b/src/otclient/core/tile.cpp @@ -201,9 +201,6 @@ void Tile::removeThingByPtr(ThingPtr thing) void Tile::clean() { - for(const ThingPtr& thing : m_creatures) - g_map.removeCreatureById(thing->getId()); - m_itemsTop.clear(); m_creatures.clear(); m_itemsBottom.clear(); diff --git a/src/otclient/net/protocolgameparse.cpp b/src/otclient/net/protocolgameparse.cpp index 633611d5..78084d3c 100644 --- a/src/otclient/net/protocolgameparse.cpp +++ b/src/otclient/net/protocolgameparse.cpp @@ -286,11 +286,6 @@ void ProtocolGame::parseMapDescription(InputMessage& msg) { Position pos = parsePosition(msg); m_localPlayer->setPosition(pos); - - // we must clean, creatures and all. - g_map.clean(); - - // now we get new map. setMapDescription(msg, pos.x - 8, pos.y - 6, pos.z, 18, 14); } @@ -952,10 +947,12 @@ ThingPtr ProtocolGame::internalGetThing(InputMessage& msg) creature = knownCreature; } else if(thingId == 0x0061) { //creature is not known - /*uint32 removeId = */msg.getU32(); + uint32 removeId = msg.getU32(); uint32 id = msg.getU32(); std::string name = msg.getString(); + g_map.removeCreatureById(removeId); + LocalPlayerPtr localPlayer = g_game.getLocalPlayer(); if(localPlayer->getId() == id) creature = localPlayer->asCreature();