fix teleport incompability with some servers

This commit is contained in:
Eduardo Bart 2012-04-28 23:02:50 -03:00
parent 008fa85635
commit dc0ade2bd0
1 changed files with 7 additions and 16 deletions

View File

@ -278,17 +278,9 @@ void Map::removeCreatureById(uint32 id)
void Map::setCentralPosition(const Position& centralPosition)
{
bool teleported = !m_centralPosition.isInRange(centralPosition, 1, 1);
m_centralPosition = centralPosition;
// remove all creatures when teleporting, the server will resend them again
if(teleported) {
for(const auto& pair : m_knownCreatures) {
const CreaturePtr& creature = pair.second;
removeThing(creature);
}
// remove creatures from tiles that we are not aware anymore
} else {
for(const auto& pair : m_knownCreatures) {
const CreaturePtr& creature = pair.second;
if(creature) {
@ -299,7 +291,6 @@ void Map::setCentralPosition(const Position& centralPosition)
else
logTraceError("invalid creature");
}
}
}
std::vector<CreaturePtr> Map::getSpectators(const Position& centerPos, bool multiFloor)