aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Globals/ObjectMgr.cpp
diff options
context:
space:
mode:
authorratkosrb <35845488+ratkosrb@users.noreply.github.com>2020-02-16 14:36:56 +0200
committerGitHub <noreply@github.com>2020-02-16 13:36:56 +0100
commit6176ce92ea01fd33b11c2e7f8e9ebb509e80c944 (patch)
treeee2dba0ebbe1ab433c09bbe14c58c600175dab50 /src/server/game/Globals/ObjectMgr.cpp
parentbaa87c43bae9df507427b3fe2d86ba25f059fdef (diff)
Core/Creature: Use proper name for wander distance. (#24133)
* Use proper name for wander distance. * Rename db field. * Fix query. * Remove underscore from chat command. * Rename the handler too. * Update chat command description. * Fix remaining issues. * Rename 2020_99_99_99_world_335.sql to 2020_02_16_01_world.sql Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 20d32e9a225..af3438aa3d0 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -2070,7 +2070,7 @@ void ObjectMgr::LoadCreatures()
uint32 oldMSTime = getMSTime();
// 0 1 2 3 4 5 6 7 8 9 10
- QueryResult result = WorldDatabase.Query("SELECT creature.guid, id, map, position_x, position_y, position_z, orientation, modelid, equipment_id, spawntimesecs, spawndist, "
+ QueryResult result = WorldDatabase.Query("SELECT creature.guid, id, map, position_x, position_y, position_z, orientation, modelid, equipment_id, spawntimesecs, wander_distance, "
// 11 12 13 14 15 16 17 18 19 20 21
"currentwaypoint, curhealth, curmana, MovementType, spawnMask, phaseMask, eventEntry, poolSpawnId, creature.npcflag, creature.unit_flags, creature.dynamicflags, "
// 22
@@ -2117,7 +2117,7 @@ void ObjectMgr::LoadCreatures()
data.displayid = fields[7].GetUInt32();
data.equipmentId = fields[8].GetInt8();
data.spawntimesecs = fields[9].GetUInt32();
- data.spawndist = fields[10].GetFloat();
+ data.wander_distance = fields[10].GetFloat();
data.currentwaypoint= fields[11].GetUInt32();
data.curhealth = fields[12].GetUInt32();
data.curmana = fields[13].GetUInt32();
@@ -2183,25 +2183,25 @@ void ObjectMgr::LoadCreatures()
data.movementType = IDLE_MOTION_TYPE;
}
- if (data.spawndist < 0.0f)
+ if (data.wander_distance < 0.0f)
{
- TC_LOG_ERROR("sql.sql", "Table `creature` has creature (GUID: %u Entry: %u) with `spawndist`< 0, set to 0.", guid, data.id);
- data.spawndist = 0.0f;
+ TC_LOG_ERROR("sql.sql", "Table `creature` has creature (GUID: %u Entry: %u) with `wander_distance`< 0, set to 0.", guid, data.id);
+ data.wander_distance = 0.0f;
}
else if (data.movementType == RANDOM_MOTION_TYPE)
{
- if (data.spawndist == 0.0f)
+ if (data.wander_distance == 0.0f)
{
- 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, replace by idle movement type (0).", guid, data.id);
data.movementType = IDLE_MOTION_TYPE;
}
}
else if (data.movementType == IDLE_MOTION_TYPE)
{
- if (data.spawndist != 0.0f)
+ if (data.wander_distance != 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);
- data.spawndist = 0.0f;
+ 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.wander_distance = 0.0f;
}
}
@@ -2332,7 +2332,7 @@ ObjectGuid::LowType ObjectMgr::AddCreatureData(uint32 entry, uint32 mapId, Posit
data.displayid = 0;
data.equipmentId = 0;
data.spawntimesecs = spawntimedelay;
- data.spawndist = 0;
+ data.wander_distance = 0;
data.currentwaypoint = 0;
data.curhealth = stats->GenerateHealth(cInfo);
data.curmana = stats->GenerateMana(cInfo);