fix teleport incompability with some servers
This commit is contained in:
parent
008fa85635
commit
dc0ade2bd0
|
@ -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) {
|
||||
|
@ -300,7 +292,6 @@ void Map::setCentralPosition(const Position& centralPosition)
|
|||
logTraceError("invalid creature");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<CreaturePtr> Map::getSpectators(const Position& centerPos, bool multiFloor)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue