Hello guys (and girls).
I'm making new ots on 8.6 version using tfs 1.2. When I want to walk throught people in PZ it's a little bit 'lagging'. Firstly i have to 'try' to stand on someone's postion, then i'm getting 'pushed' back where i was and after it I can go through him. Any fixs ?
Here is my code.
I'm making new ots on 8.6 version using tfs 1.2. When I want to walk throught people in PZ it's a little bit 'lagging'. Firstly i have to 'try' to stand on someone's postion, then i'm getting 'pushed' back where i was and after it I can go through him. Any fixs ?
Code:
bool Player::canWalkthrough(const Creature* creature) const
{
if (group->access || creature->isInGhostMode()) {
return true;
}
const Player* player = creature->getPlayer();
if (!player) {
return false;
}
const Tile* playerTile = player->getTile();
if (!playerTile || !playerTile->hasFlag(TILESTATE_PROTECTIONZONE)) {
return false;
}
const Item* playerTileGround = playerTile->getGround();
if (!playerTileGround || !playerTileGround->hasWalkStack()) {
return false;
}
Player* thisPlayer = const_cast<Player*>(this);
if ((OTSYS_TIME() - lastWalkthroughAttempt) > 2000) {
thisPlayer->setLastWalkthroughAttempt(OTSYS_TIME());
return false;
}
if (creature->getPosition() != lastWalkthroughPosition) {
thisPlayer->setLastWalkthroughPosition(creature->getPosition());
return false;
}
thisPlayer->setLastWalkthroughPosition(creature->getPosition());
return true;
}
bool Player::canWalkthroughEx(const Creature* creature) const
{
if (group->access) {
return true;
}
const Player* player = creature->getPlayer();
if (!player) {
return false;
}
const Tile* playerTile = player->getTile();
return playerTile && playerTile->hasFlag(TILESTATE_PROTECTIONZONE);
}
Here is my code.