Fortera Global
Intermediate OT User
- Joined
- Nov 20, 2015
- Messages
- 1,180
- Solutions
- 2
- Reaction score
- 117
Hello someone know edit for avoid npc walk into charis, tables, box, etc?
C++:
bool Npc::canWalkTo(const Position& fromPos, Direction dir) const
{
if (masterRadius == 0) {
return false;
}
Position toPos = getNextPosition(dir, fromPos);
if (!Spawns::isInZone(masterPos, masterRadius, toPos)) {
return false;
}
Tile* tile = g_game.map.getTile(toPos);
if (!tile || tile->queryAdd(0, *this, 1, 0) != RETURNVALUE_NOERROR) {
return false;
}
if (!floorChange && (tile->hasFlag(TILESTATE_FLOORCHANGE) || tile->getTeleportItem())) {
return false;
}
if (!ignoreHeight && tile->hasHeight(1)) {
return false;
}
return true;
}