diff options
author | ratkosrb <35845488+ratkosrb@users.noreply.github.com> | 2021-12-21 19:50:12 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-12-21 19:50:12 +0100 |
commit | 72093e98e1bdbd3b83d8030d1cb50306bb04b028 (patch) | |
tree | 83784486b449e67e8f38949b4a6d38bd5793f53e /src/server/game/Globals/ObjectMgr.cpp | |
parent | 460549799ee6116ca39751226e3aededab04ac6a (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>
(cherry picked from commit 6176ce92ea01fd33b11c2e7f8e9ebb509e80c944)
# Conflicts:
# sql/updates/world/master/2020_02_16_01_world.sql
# src/server/database/Database/Implementation/WorldDatabase.cpp
# src/server/game/Entities/Creature/Creature.cpp
# src/server/game/Globals/ObjectMgr.cpp
# src/server/game/Globals/ObjectMgr.h
# src/server/scripts/Commands/cs_npc.cpp
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 1ad91d8f9c2..9273c826ec0 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2075,7 +2075,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, spawnDifficulties, eventEntry, poolSpawnId, creature.npcflag, creature.unit_flags, creature.unit_flags2, creature.unit_flags3, " // 22 23 24 25 26 27 @@ -2122,7 +2122,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(); @@ -2208,25 +2208,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: " UI64FMTD " 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: " UI64FMTD " 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 (G3D::fuzzyEq(data.spawndist, 0.0f)) + if (G3D::fuzzyEq(data.wander_distance, 0.0f)) { - TC_LOG_ERROR("sql.sql", "Table `creature` has creature (GUID: " UI64FMTD " 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: " UI64FMTD " 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: " UI64FMTD " 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: " UI64FMTD " Entry: %u) with `MovementType`=0 (idle) have `wander_distance`<>0, set to 0.", guid, data.id); + data.wander_distance = 0.0f; } } @@ -2395,7 +2395,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 = sDB2Manager.EvaluateExpectedStat(ExpectedStatType::CreatureHealth, level, cInfo->GetHealthScalingExpansion(), scaling->ContentTuningID, Classes(cInfo->unit_class)) * cInfo->ModHealth * cInfo->ModHealthExtra; data.curmana = stats->GenerateMana(cInfo); |