• 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++ [0.4] canWalkthrough on summons

elnelson

Lunaria World Dev
Joined
Jun 20, 2009
Messages
586
Solutions
2
Reaction score
61
Location
México
Hello, otlanders. im requiring some help trying to figure out how to make possible to be able to walk over summons
im using tfs 0.4.3777 r19 and this is the canWalkthrough part of the source.
C++:
bool Player::canWalkthrough(const Creature* creature) const
{
    if(creature == this || hasFlag(PlayerFlag_CanPassThroughAllCreatures) || creature->isWalkable() ||
        std::find(forceWalkthrough.begin(), forceWalkthrough.end(), creature->getID()) != forceWalkthrough.end()
            || (creature->getMaster() && creature->getMaster() != this && canWalkthrough(creature->getMaster())))
        return true;

    const Player* player = creature->getPlayer();
    if(!player)
        return false;

    if((((g_game.getWorldType() == WORLDTYPE_OPTIONAL &&
        !player->isEnemy(this, true) &&
        player->getVocation()->isAttackable()) || player->getTile()->hasFlag(TILESTATE_PROTECTIONZONE) || (player->getVocation()->isAttackable()
            && player->getLevel() < (uint32_t)g_config.getNumber(ConfigManager::PROTECTION_LEVEL))) && player->getTile()->ground &&
        Item::items[player->getTile()->ground->getID()].walkStack) && (!player->hasCustomFlag(PlayerCustomFlag_GamemasterPrivileges)
        || player->getAccess() <= getAccess()))
        return true;

    return (player->isGhost() && getGhostAccess() < player->getGhostAccess())
        || (isGhost() && getGhostAccess() > player->getGhostAccess());
}


thanks in advance
 
You have to update the creature after it is summoned with the walkthrough information. Keep searching the forums you will find the answer.
 
Back
Top