• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved Player "inside" player.

gerard95

Keep cool :)
Joined
Dec 31, 2011
Messages
276
Reaction score
16
How to change the fact that 2 players can stack together?
I have problems with this feature, I need to change it.

Thank you a lot :)
 
This is Source Edits here you are
in players.cpp
find
Code:
bool Player::canWalkthrough(const Creature* creature) const
Replace With This
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());
}

Players must be lower than the protection level in config
 
Back
Top