creatures name fix

This commit is contained in:
Henrique 2011-08-26 18:34:16 -03:00
parent ccc4c1ba5e
commit 4d9c974c34
3 changed files with 3 additions and 10 deletions

View File

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

View File

@ -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();

View File

@ -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();