Core/Movement: random movement now requires a minimum wander distance of 0.1 yards
This commit is contained in:
1 parent
ab1b089b80
commit
e9fecb39d8
2 files changed
+6
-6
No files matched your search
@@ -2176,16 +2176,16 @@ void ObjectMgr::LoadCreatures()
|
||||
data.movementType = IDLE_MOTION_TYPE;
|
||||
}
|
||||
|
||||
if (data.wanderDistance < 0.0f)
|
||||
if (data.wanderDistance < 0.1f)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table `creature` has creature (GUID: %u Entry: %u) with `spawndist`< 0, set to 0.", guid, data.id);
|
||||
TC_LOG_ERROR("sql.sql", "Table `creature` has creature (GUID: %u Entry: %u) with `wander_distance`< 0.1, set to 0.", guid, data.id);
|
||||
data.wanderDistance = 0.0f;
|
||||
}
|
||||
else if (data.movementType == RANDOM_MOTION_TYPE)
|
||||
{
|
||||
if (G3D::fuzzyEq(data.wanderDistance, 0.0f))
|
||||
if (G3D::fuzzyEq(data.wanderDistance, 0.1f))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table `creature` has creature (GUID: %u Entry: %u) with `MovementType`=1 (random movement) but with `spawndist`=0, replace by idle movement type (0).", guid, data.id);
|
||||
TC_LOG_ERROR("sql.sql", "Table `creature` has creature (GUID: %u Entry: %u) with `MovementType`= 1 (random movement) but with `wander_distance`= 0.1, replace by idle movement type (0).", guid, data.id);
|
||||
data.movementType = IDLE_MOTION_TYPE;
|
||||
}
|
||||
}
|
||||
@@ -2193,7 +2193,7 @@ void ObjectMgr::LoadCreatures()
|
||||
{
|
||||
if (data.wanderDistance != 0.0f)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table `creature` has creature (GUID: %u Entry: %u) with `MovementType`=0 (idle) have `spawndist`<>0, set to 0.", guid, data.id);
|
||||
TC_LOG_ERROR("sql.sql", "Table `creature` has creature (GUID: %u Entry: %u) with `MovementType`=0 (idle) have `wander_distance`<>0, set to 0.", guid, data.id);
|
||||
data.wanderDistance = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ void RandomMovementGenerator<Creature>::SetRandomLocation(Creature* owner)
|
||||
owner->AddUnitState(UNIT_STATE_ROAMING_MOVE);
|
||||
|
||||
Position position(_reference);
|
||||
float distance = frand(0.f, _wanderDistance);
|
||||
float distance = frand(0.1f, _wanderDistance);
|
||||
float angle = frand(0.f, float(M_PI * 2));
|
||||
owner->MovePositionToFirstCollision(position, distance, angle);
|
||||
|
||||
|
||||
Reference in new issue
Block a user