Engine optimization for better performance and mem usage (#1462)

* Optimize loot

* World channel talk

* General improvement

* Engine rebuild for performance and memory usage

* Fix crash with AutoDoQuest = 0
This commit is contained in:
Yunfan Li
2025-07-25 18:11:03 +08:00
committed by GitHub
parent 4a00c954ed
commit feda619066
36 changed files with 831 additions and 237 deletions

View File

@@ -84,7 +84,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;
@@ -163,8 +163,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);