Core/Movement: fixed up logic in previously added random movement minumum wander distance check and prevent the random movement generator from launching too short splines

This commit is contained in:
Ovahlord committed 2023-08-19 14:51:31 +02:00
1 parent e9fecb39d8
commit dfa6f7a709
2 files changed
+16 -5

No files matched your search

+8 -3
View File
@@ -2176,16 +2176,21 @@ void ObjectMgr::LoadCreatures()
data.movementType = IDLE_MOTION_TYPE;
}
if (data.wanderDistance < 0.1f)
if (data.wanderDistance < 0.0f)
{
TC_LOG_ERROR("sql.sql", "Table `creature` has creature (GUID: %u Entry: %u) with `wander_distance`< 0.0, set to 0.", guid, data.id);
data.wanderDistance = 0.0f;
}
else if (data.wanderDistance > 0.0f && data.wanderDistance < 0.1f)
{
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.1f))
if (G3D::fuzzyEq(data.wanderDistance, 0.0f))
{
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);
TC_LOG_ERROR("sql.sql", "Table `creature` has creature (GUID: %u Entry: %u) with `MovementType`= 1 (random movement) but with `wander_distance`= 0, replace by idle movement type (0).", guid, data.id);
data.movementType = IDLE_MOTION_TYPE;
}
}