• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Summon tp to pz

zapo

Member
Joined
Nov 10, 2020
Messages
110
Solutions
2
Reaction score
8
Hi, creature creating by 'utevo res 'name'' can tp to pz for example when i go uppster.

How to disable teleporting this summon?

Otservbr
TFS 1.3
 
Solution
Unfortunately it doesn't work

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) {
        //check if summon name contains "familiar"
        if (summon->getName().find('familiar') != std::string::npos) {
            const Position& pos = summon->getPosition();
            if (Position::getDistanceZ(newPos, pos) > 0 || (std::max<int32_t>(Position::getDistanceX(newPos, pos), Position::getDistanceY(newPos, pos)) > 15)) {
                g_game.internalTeleport(summon, summon->getMaster()->getPosition(), true);
            }
        }...

Pox

Well-Known Member
Joined
Apr 28, 2020
Messages
126
Solutions
7
Reaction score
87
Unfortunately it doesn't work

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) {
        //check if summon name contains "familiar"
        if (summon->getName().find('familiar') != std::string::npos) {
            const Position& pos = summon->getPosition();
            if (Position::getDistanceZ(newPos, pos) > 0 || (std::max<int32_t>(Position::getDistanceX(newPos, pos), Position::getDistanceY(newPos, pos)) > 15)) {
                g_game.internalTeleport(summon, summon->getMaster()->getPosition(), true);
            }
        }
    }
   
    for (Creature* despawnCreature : despawnList) {
        g_game.removeCreature(despawnCreature, true);
    }
}
 
Last edited:
Solution
Top