Postado Julho 18, 2023 1 ano Olá, procurei aqui no fórum alguns posts em relação a esse problema mas gostaria de algo relacionado a source. Versão: 8.60 TFS: 0.4 Minhas sources estão assim, player.cpp 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() == 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()); } e const.h enum PlayerCustomFlags { PlayerCustomFlag_AllowIdle = 0, //2^0 = 1 PlayerCustomFlag_CanSeePosition, //2^1 = 2 PlayerCustomFlag_CanSeeItemDetails, //2^2 = 4 PlayerCustomFlag_CanSeeCreatureDetails, //2^3 = 8 PlayerCustomFlag_NotSearchable, //2^4 = 16 PlayerCustomFlag_GamemasterPrivileges, //2^5 = 32 PlayerCustomFlag_CanThrowAnywhere, //2^6 = 64 PlayerCustomFlag_CanPushAllItems, //2^7 = 128 PlayerCustomFlag_CanMoveAnywhere, //2^8 = 256 PlayerCustomFlag_CanMoveFromFar, //2^9 = 512 PlayerCustomFlag_CanLoginMultipleCharacters, //2^10 = 1024 (account flag) PlayerCustomFlag_HasFullLight, //2^11 = 2048 PlayerCustomFlag_CanLogoutAnytime, //2^12 = 4096 (account flag) PlayerCustomFlag_HideLevel, //2^13 = 8192 PlayerCustomFlag_IsProtected, //2^14 = 16384 PlayerCustomFlag_IsImmune, //2^15 = 32768 PlayerCustomFlag_NotGainSkull, //2^16 = 65536 PlayerCustomFlag_NotGainUnjustified, //2^17 = 131072 PlayerCustomFlag_IgnorePacification, //2^18 = 262144 PlayerCustomFlag_IgnoreLoginDelay, //2^19 = 524288 PlayerCustomFlag_CanStairhop, //2^20 = 1048576 PlayerCustomFlag_CanTurnhop, //2^21 = 2097152 PlayerCustomFlag_IgnoreHouseRent, //2^22 = 4194304 PlayerCustomFlag_CanWearAllAddons, //2^23 = 8388608 PlayerCustomFlag_IsWalkable, //2^24 = 16777216 PlayerCustomFlag_CanWalkthrough, //2^25 = 33554432 PlayerCustomFlag_LastFlag }; acredito que essa parte é onde está deixando os players passar por dentro de outro, consigo mudar para que os players não passem um por dentro do outro em area pz? Obrigado desde já Editado Julho 18, 2023 1 ano por moleza (veja o histórico de edições)
Postado Julho 18, 2023 1 ano Diretor Soluçã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 o jogador atual e o outro jogador estão em uma área de proteção (PZ) e impede a passagem. bool thisPlayerInPZ = getTile()->hasFlag(TILESTATE_PROTECTIONZONE); bool otherPlayerInPZ = player->getTile()->hasFlag(TILESTATE_PROTECTIONZONE); if (thisPlayerInPZ && otherPlayerInPZ) return false; // Restante do código... // (Mantenha as outras verificações que você deseja manter para permitir a passagem em outras situações) return (player->isGhost() && getGhostAccess() < player->getGhostAccess()) || (isGhost() && getGhostAccess() > player->getGhostAccess()); } Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código. #OpenSource #Programação #Contribuição
Postado Julho 18, 2023 1 ano Autor @L3K0T Muito obrigado, funcionando 100% Editado Julho 18, 2023 1 ano por moleza (veja o histórico de edições)
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.