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

C++ bool Player::canWalkthrough

beliar34

Member
Joined
Feb 28, 2012
Messages
307
Solutions
7
Reaction score
11
Code:
bool Player::canWalkthrough(const Creature* creature) const
{
    if(creature == this || creature->isWalkable() ||
        (creature->getMaster() && creature->getMaster() != this && canWalkthrough(creature->getMaster())))
        return true;
    const Player* player = creature->getPlayer();
    if(!player)
        return false;
    if(
        (
            (
                (
                    (
                        player->getVocation()->isAttackable() &&
                        player->getLevel() < (uint32_t)g_config.getNumber(ConfigManager::PROTECTION_LEVEL)
                    )
                    || (
                        player->getTile()->hasFlag(TILESTATE_PROTECTIONZONE) &&
                        !player->getTile()->hasFlag(TILESTATE_HOUSE)
                    )
                )
            ) && player->getTile()->ground &&
                player->getTile()->ground->getID() != 11063
        ) && (
            !player->hasCustomFlag(PlayerCustomFlag_GamemasterPrivileges)
            || player->getAccess() <= getAccess()
        )
    ) return true;
    return (player->isGhost() && getGhostAccess() < player->getGhostAccess())
        || (isGhost() && getGhostAccess() > player->getGhostAccess());
}
Dosent work, still cant walk trought players, i tested in many ways (tried to walk with god trought player, player trought god, tried to walk player with low lvl to low lvl, low lvl to h lvl, h lvl to low lvl, h lvl to h lvl) nothing works,
TFS 0.3.5
 
In this function just should be removed that part:
Code:
g_game.getWorldType ()==WORLD_TYPE_NO_PVP

or give that function once again in the original condition.

btw even though you will not be able to go any players through god, cm or gm
 
In this function just should be removed that part:
Code:
g_game.getWorldType ()==WORLD_TYPE_NO_PVP

or give that function once again in the original condition.

btw even though you will not be able to go any players through god, cm or gm

also have you got protection level in config.lua?

I got protection level
g_game.getWorldType ()== < i dont have this function 0.o did you even read my code?
 
Under which circumstances do you want players to be able to walk through each other?

You should format your code properly! Otherwise nobody will be able to read it.
 
i want to let people go trought each other when :
They are in protection zone (always with
Under which circumstances do you want players to be able to walk through each other?

You should format your code properly! Otherwise nobody will be able to read it.
i want to let them walk in each other like in 0.4 tfs :)
In protection zone
When player is protected (cant be attacked in pvp) he can pass everyplayer and everyplayer can pass him
 
refresh

@WibbenZ maybye you can help ?

update : with my script (from 1 post) players can walk trought each other when they go on same sqm in the same second, and player stack when i teleport them but when one is standing still and the other one is trying to get on the same SQM he got error "sorry not possible" any ideas? its propably blocked somewhere else in sources tfs 0.3.5
 
Last edited by a moderator:
it looks fine tbh? i copied your code to my tfs 0.4, and it worked excellent to walk through people.
might be client sided?
 
@Update
when i try mapclick trought player i got msg : there is no way but when i ppm on something behind him i go trought player, any ideas whats wrong?

@Update

can walk trought player when i use something behind him but cant go trought him with map click or arrows i got error sorry not possible "RET_NOTPOSSIBLE" i searched all cpp files for this blockade and cant find anything related to go trought another creature/player
GUYS HELP! :( @Summ @Static_ any ideas?
 
Last edited:
When map clicking the client calculates the path and considers any monster/creature to be blocking. When using an item (and basically any other action) the server calculates the path and you should properly walk through the creatures that you may walk through.
 
When map clicking the client calculates the path and considers any monster/creature to be blocking. When using an item (and basically any other action) the server calculates the path and you should properly walk through the creatures that you may walk through.
How to unlock them in tibia 8.5 client?
how should dat files look like ?


UPDATE : tested with ot client, same problem still cant go trought player with map click/arrows
 
Last edited:
Back
Top