• 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++] Walking through players in PZ - Small Fixes

Status
Not open for further replies.

xapokis

Member
Joined
Nov 4, 2012
Messages
112
Reaction score
6
Hi

Well i have this code (made by Cykotitan) to make players walk through others in PZ.

Code:
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 &&
#ifdef __WAR_SYSTEM__
		!player->isEnemy(this, true) &&
#endif
		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;

But it has these issues:

1-Gods cant walkthrough players when they are out of PZ Zone
2-Sometimes someplayers got bugged, you cant walk through them and get the "Sorry not possible" error (i'm testing to find what is wrong)
3-Players cant walkthrough Gods when they (gods) are in pz
4-Players and Gods cant walkthrough NPCs

Using TFS 0.4 rev 3884 - 8.60

Edit1: about issue 2: seems that reloging the bugged player fix it
 
Last edited:
Status
Not open for further replies.
Back
Top