General improvement

This commit is contained in:
Yunfan Li 2025-07-21 11:39:22 +08:00
parent c9d341cb36
commit eff9873272
3 changed files with 12 additions and 12 deletions

View File

@ -78,7 +78,7 @@ bool NewRpgBaseAction::MoveFarTo(WorldPosition dest)
float rx, ry, rz;
bool found = false;
int attempt = 3;
while (--attempt)
while (attempt--)
{
float angle = bot->GetAngle(&dest);
float delta = urand(1, 100) <= 75 ? (rand_norm() - 0.5) * M_PI * 0.5 : (rand_norm() - 0.5) * M_PI * 2;
@ -157,8 +157,8 @@ bool NewRpgBaseAction::MoveRandomNear(float moveStep, MovementPriority priority)
const float x = bot->GetPositionX();
const float y = bot->GetPositionY();
const float z = bot->GetPositionZ();
int attempts = 5;
while (--attempts)
int attempts = 1;
while (attempts--)
{
float angle = (float)rand_norm() * 2 * static_cast<float>(M_PI);
float dx = x + distance * cos(angle);

View File

@ -195,6 +195,8 @@ bool GrindTargetValue::needForQuest(Unit* target)
return true;
}
}
}
}
if (CreatureTemplate const* data = sObjectMgr->GetCreatureTemplate(target->GetEntry()))
{
@ -206,8 +208,6 @@ bool GrindTargetValue::needForQuest(Unit* target)
}
}
}
}
}
return false;
}

View File

@ -15,7 +15,7 @@ class NearestCorpsesValue : public NearestUnitsValue
{
public:
NearestCorpsesValue(PlayerbotAI* botAI, float range = sPlayerbotAIConfig->sightDistance)
: NearestUnitsValue(botAI, "nearest corpses", range)
: NearestUnitsValue(botAI, "nearest corpses", range, true)
{
}