As topic says, I found something in sources of latest tfs 1.3 repo but is it a borked function or what do these lines even do?
I tried to change to internal teleport instead but without any success: (credits to: otservbr)
On a sidenote, Is it possible to let summons walk in/out of PZ without an entire change of sources?
C++:
if (!summons.empty()) {
//check if any of our summons is out of range (+/- 2 floors or 30 tiles away)
std::forward_list<Creature*> despawnList;
for (Creature* summon : summons) {
const Position& pos = summon->getPosition();
if (Position::getDistanceZ(newPos, pos) > 2 || (std::max<int32_t>(Position::getDistanceX(newPos, pos), Position::getDistanceY(newPos, pos)) > 30)) {
despawnList.push_front(summon);
}
}
for (Creature* despawnCreature : despawnList) {
g_game.removeCreature(despawnCreature, true);
}
}
I tried to change to internal teleport instead but without any success: (credits to: otservbr)
C++:
if (!summons.empty()) {
//check if any of our summons is out of range (+/- 2 floors or 30 tiles away)
std::forward_list<Creature*> despawnList;
for (Creature* summon : summons) {
const Position& pos = summon->getPosition();
if (Position::getDistanceZ(newPos, pos) > 1 || (std::max<int32_t>(Position::getDistanceX(newPos, pos), Position::getDistanceY(newPos, pos)) > 5)) {
g_game.internalTeleport(summon, summon->getMaster()->getPosition(), true);
}
}
for (Creature* despawnCreature : despawnList) {
g_game.removeCreature(despawnCreature, true);
}
}
On a sidenote, Is it possible to let summons walk in/out of PZ without an entire change of sources?