• 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!

TFS 0.X TP to templo If no free sqm

willks123

New Member
Joined
Dec 31, 2012
Messages
64
Reaction score
2
My server is otx 2 - 0.7 .... And it is not giving TP to the city when there is no place to spawn. The player spawns on the table, pot, other players... I want it to be like it was in 7.4 if there is no place to spawn, it goes back to the temple. Can someone help me? please...
 
Change this
To this
If tile->hasProperty(BLOCKSOLID) didn't work then add this instead tile->hasFlag(TILESTATE_BLOCKSOLID)
 
Change this
To this
If tile->hasProperty(BLOCKSOLID) didn't work then add this instead tile->hasFlag(TILESTATE_BLOCKSOLID)
How would be for tfs 1.x?
 
Last edited:
You tried this one? tile->hasFlag(TILESTATE_BLOCKSOLID)
C++:
if(!(tile = getTile(tryPos)) || (placeInPz && !tile->hasFlag(TILESTATE_PROTECTIONZONE)) || tile->hasFlag(TILESTATE_BLOCKSOLID))

We changed it, but the binary compiled, but it still has the same problem.

when logging in on top of items that cannot be transposed, the character does not teleport to the temple.

1669952487826.png
 

Attachments

i saw this from kay
"
That's not true. You never could tp yourself using furniture stuff in real tibia. Only other creatures and immoble objects.

If you want to change it regardless of the above: it's in map.cpp file, PlaceCreature() function. This line I believe:"

how to make possible to teleport others player using the code as described?
tp player only if creatures/players or immobile objects?
 
i saw this from kay
"
That's not true. You never could tp yourself using furniture stuff in real tibia. Only other creatures and immoble objects.

If you want to change it regardless of the above: it's in map.cpp file, PlaceCreature() function. This line I believe:"

how to make possible to teleport others player using the code as described?
tp player only if creatures/players or immobile objects?
Hello,

Can you tell me what modifications I need to make in the function below so that the character is teleported with furniture stuff or players?

the teleport does not happen either with furniture or with players.

Attached is the map.cpp file

C++:
bool Map::placeCreature(const Position& centerPos, Creature* creature, bool extendedPos /*= false*/, bool forced /*= false*/)
{
    bool foundTile = false, placeInPz = false;
    Tile* tile = getTile(centerPos);
    if(tile && !extendedPos)
    {
        placeInPz = tile->hasFlag(TILESTATE_PROTECTIONZONE);
        uint32_t flags = FLAG_IGNOREBLOCKITEM;
        if(creature->isAccountManager())
            flags |= FLAG_IGNOREBLOCKCREATURE;

        ReturnValue ret = tile->__queryAdd(0, creature, 1, flags);
        if(forced || ret == RET_NOERROR || ret == RET_PLAYERISNOTINVITED)
            foundTile = true;
    }

    size_t shufflePos = 0;
    PairVector relList;
    if(extendedPos)
    {
        shufflePos = 8;
        relList.push_back(PositionPair(-2, 0));
        relList.push_back(PositionPair(0, -2));
        relList.push_back(PositionPair(0, 2));
        relList.push_back(PositionPair(2, 0));
        std::random_shuffle(relList.begin(), relList.end());
    }

    relList.push_back(PositionPair(-1, -1));
    relList.push_back(PositionPair(-1, 0));
    relList.push_back(PositionPair(-1, 1));
    relList.push_back(PositionPair(0, -1));
    relList.push_back(PositionPair(0, 1));
    relList.push_back(PositionPair(1, -1));
    relList.push_back(PositionPair(1, 0));
    relList.push_back(PositionPair(1, 1));
    std::random_shuffle(relList.begin() + shufflePos, relList.end());

    uint32_t radius = 1;
    Position tryPos;
    for(uint32_t n = 1; n <= radius && !foundTile; ++n)
    {
        for(PairVector::iterator it = relList.begin(); it != relList.end() && !foundTile; ++it)
        {
            int32_t dx = it->first * n, dy = it->second * n;
            tryPos = centerPos;

            tryPos.x = tryPos.x + dx;
            tryPos.y = tryPos.y + dy;
            if(!(tile = getTile(tryPos)) || (placeInPz && !tile->hasFlag(TILESTATE_PROTECTIONZONE)) || tile->hasFlag(TILESTATE_BLOCKSOLID))
                continue;

            if(tile->__queryAdd(0, creature, 1, 0) == RET_NOERROR)
            {
                if(!extendedPos)
                {
                    foundTile = true;
                    break;
                }

                if(isSightClear(centerPos, tryPos, false))
                {
                    foundTile = true;
                    break;
                }
            }
        }
    }

    if(!foundTile)
        return false;

    int32_t index = 0;
    uint32_t flags = 0;

    Item* toItem = NULL;
    if(Cylinder* toCylinder = tile->__queryDestination(index, creature, &toItem, flags))
    {
        toCylinder->__internalAddThing(creature);
        if(Tile* toTile = toCylinder->getTile())
            toTile->qt_node->addCreature(creature);
    }

    return true;
}
 

Attachments

We were able to resolve this issue on my server. For those who have the same problem, you have to follow what M0ustafa said and also look at this part:

uint32_t flags = FLAG_IGNOREBLOCKITEM;

Well, the problem is there.

Thanks a lot for the help...
 
Same problem here , i changed that - If tile->hasProperty(BLOCKSOLID) didn't work then add this instead tile->hasFlag(TILESTATE_BLOCKSOLID)
But still not managed to work
 
Back
Top