Muvuka 1 Posted July 15, 2024 Report Share Posted July 15, 2024 bool Player::canWalkthrough(const Creature* creature) const { if(creature == this || hasCustomFlag(PlayerCustomFlag_CanWalkthrough) || creature->isWalkable() || (creature->getMaster() && creature->getMaster() != this && canWalkthrough(creature->getMaster()))) return true; const Player* player = creature->getPlayer(); if(!player) return false; if((((g_game.getWorldType() == WORLD_TYPE_NO_PVP && player->getVocation()->isAttackable()) || player->getTile()->hasFlag(TILESTATE_PROTECTIONZONE) || (player->getVocation()->isAttackable() && player->getLevel() < (uint32_t)g_config.getNumber(ConfigManager::PROTECTION_LEVEL))) && player->getTile()->ground) && (!player->hasCustomFlag(PlayerCustomFlag_GamemasterPrivileges) || player->getAccess() <= getAccess())) return true; return (player->isGhost() && getGhostAccess() < player->getGhostAccess()) || (isGhost() && getGhostAccess() > player->getGhostAccess()); } Link to comment https://xtibia.com/forum/topic/259683-c-tfs-036-860-bug-player-entra-dentro-do-player-no-depot/ Share on other sites More sharing options...
1 El Rusher 43 Posted July 22, 2024 Report Share Posted July 22, 2024 Para ajustar o código e garantir que um jogador não possa atravessar outro jogador no depósito, você pode modificar a função canWalkthrough para retornar false quando os jogadores estiverem no depósito. Aqui está uma versão atualizada da função que adiciona esta verificação: bool Player::canWalkthrough(const Creature* creature) const { if (creature == this || hasCustomFlag(PlayerCustomFlag_CanWalkthrough) || creature->isWalkable() || (creature->getMaster() && creature->getMaster() != this && canWalkthrough(creature->getMaster()))) return true; const Player* player = creature->getPlayer(); if (!player) return false; // Verifica se os jogadores estão no depósito if (player->getTile()->hasFlag(TILESTATE_DEPOT) || this->getTile()->hasFlag(TILESTATE_DEPOT)) { return false; } if ((((g_game.getWorldType() == WORLD_TYPE_NO_PVP && player->getVocation()->isAttackable()) || player->getTile()->hasFlag(TILESTATE_PROTECTIONZONE) || (player->getVocation()->isAttackable() && player->getLevel() < (uint32_t)g_config.getNumber(ConfigManager::PROTECTION_LEVEL))) && player->getTile()->ground) && (!player->hasCustomFlag(PlayerCustomFlag_GamemasterPrivileges) || player->getAccess() <= getAccess())) return true; return (player->isGhost() && getGhostAccess() < player->getGhostAccess()) || (isGhost() && getGhostAccess() > player->getGhostAccess()); } Aqui, adicionamos a verificação: if (player->getTile()->hasFlag(TILESTATE_DEPOT) || this->getTile()->hasFlag(TILESTATE_DEPOT)) { return false; } Link to comment https://xtibia.com/forum/topic/259683-c-tfs-036-860-bug-player-entra-dentro-do-player-no-depot/#findComment-1775154 Share on other sites More sharing options...
Question
Muvuka 1
Link to comment
https://xtibia.com/forum/topic/259683-c-tfs-036-860-bug-player-entra-dentro-do-player-no-depot/Share on other sites
1 answer to this question
Recommended Posts