Core/Movement: random movement now requires a minimum wander distance of 0.1 yards

This commit is contained in:
Ovahlord committed 2023-08-19 14:33:01 +02:00
1 parent ab1b089b80
commit e9fecb39d8
2 files changed
+6 -6

No files matched your search

+5 -5
View File
@@ -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;
}
}