Hello community
In this npc code here
How can i add a condition check inside this function, to npc check spectators, if have players more than 10 sqm of npc's, return false the function getNextStep, someone can help me?
Thanks in advance
In this npc code here
C++:
bool Npc::getNextStep(Direction& dir, uint32_t& flags)
{
if (Creature::getNextStep(dir, flags)) {
return true;
}
if (baseSpeed <= 0) {
return false;
}
if (focusCreature != 0) {
return false;
}
if (OTSYS_TIME() < staticMovementTime) {
return false;
}
if (getTimeSinceLastMove() < 100 + getStepDuration() + getStepSpeed()) {
return false;
}
return getRandomStep(dir);
}
Thanks in advance