diff --git a/src/strategy/actions/NewRpgAction.cpp b/src/strategy/actions/NewRpgAction.cpp index 906af1da..40ea5c12 100644 --- a/src/strategy/actions/NewRpgAction.cpp +++ b/src/strategy/actions/NewRpgAction.cpp @@ -348,19 +348,19 @@ bool NewRpgMoveNpcAction::Execute(Event event) } else angle = 2 * M_PI * rand_norm(); // A circle around the target. - - x += cos(angle) * INTERACTION_DISTANCE * rand_norm(); - y += sin(angle) * INTERACTION_DISTANCE * rand_norm(); - bool exact = true; + float rnd = rand_norm(); + x += cos(angle) * INTERACTION_DISTANCE * rnd; + y += sin(angle) * INTERACTION_DISTANCE * rnd; + // bool exact = true; if (!unit->GetMap()->CheckCollisionAndGetValidCoords(unit, unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), x, y, z)) { x = unit->GetPositionX(); y = unit->GetPositionY(); z = unit->GetPositionZ(); - exact = false; + // exact = false; } - return MoveTo(mapId, x, y, z, false, false, false, exact); + return MoveTo(mapId, x, y, z, false, false, false, true); } return true; } \ No newline at end of file diff --git a/src/strategy/generic/NewRpgStrategy.h b/src/strategy/generic/NewRpgStrategy.h index 93adff84..36ddb67d 100644 --- a/src/strategy/generic/NewRpgStrategy.h +++ b/src/strategy/generic/NewRpgStrategy.h @@ -68,14 +68,14 @@ struct NewRpgInfo break; case NewRpgStatus::NEAR_RANDOM: out << "NEAR_RANDOM"; - out << "\nlastNearNpc: " << lastNearRandom; + out << "\nlastNearRandom: " << lastNearRandom; break; case NewRpgStatus::IDLE: out << "IDLE"; break; case NewRpgStatus::REST: out << "REST"; - out << "\nlastNearNpc: " << lastRest; + out << "\nlastRest: " << lastRest; break; default: out << "UNKNOWN";