mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-21 02:20:00 +01:00
General improvement
This commit is contained in:
parent
c9d341cb36
commit
eff9873272
@ -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);
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user