creatures name fix

master
Henrique 13 years ago
parent ccc4c1ba5e
commit 4d9c974c34

@ -155,7 +155,6 @@ void Map::removeThingByPtr(ThingPtr thing)
void Map::clean() void Map::clean()
{ {
m_tiles.clear(); m_tiles.clear();
m_creatures.clear();
} }
void Map::cleanTile(const Position& pos) void Map::cleanTile(const Position& pos)

@ -201,9 +201,6 @@ void Tile::removeThingByPtr(ThingPtr thing)
void Tile::clean() void Tile::clean()
{ {
for(const ThingPtr& thing : m_creatures)
g_map.removeCreatureById(thing->getId());
m_itemsTop.clear(); m_itemsTop.clear();
m_creatures.clear(); m_creatures.clear();
m_itemsBottom.clear(); m_itemsBottom.clear();

@ -286,11 +286,6 @@ void ProtocolGame::parseMapDescription(InputMessage& msg)
{ {
Position pos = parsePosition(msg); Position pos = parsePosition(msg);
m_localPlayer->setPosition(pos); 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); setMapDescription(msg, pos.x - 8, pos.y - 6, pos.z, 18, 14);
} }
@ -952,10 +947,12 @@ ThingPtr ProtocolGame::internalGetThing(InputMessage& msg)
creature = knownCreature; creature = knownCreature;
} }
else if(thingId == 0x0061) { //creature is not known else if(thingId == 0x0061) { //creature is not known
/*uint32 removeId = */msg.getU32(); uint32 removeId = msg.getU32();
uint32 id = msg.getU32(); uint32 id = msg.getU32();
std::string name = msg.getString(); std::string name = msg.getString();
g_map.removeCreatureById(removeId);
LocalPlayerPtr localPlayer = g_game.getLocalPlayer(); LocalPlayerPtr localPlayer = g_game.getLocalPlayer();
if(localPlayer->getId() == id) if(localPlayer->getId() == id)
creature = localPlayer->asCreature(); creature = localPlayer->asCreature();

Loading…
Cancel
Save