diff options
| author | Shauren <shauren.trinity@gmail.com> | 2012-02-18 16:20:00 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2012-02-18 16:20:00 +0100 |
| commit | da5027ef3a4b7c89cb51841902dc3525c6c199f8 (patch) | |
| tree | 045a0f97ec0e1ea200608537fe1db9e0be07bf4e /src | |
| parent | a67b3116e9aaaedf0bab5fa59fd30876e8a07ffd (diff) | |
Core/ObjectMgr: Warn about creatures that have waypoint movement type set but no path assigned on startup
Diffstat (limited to 'src')
| -rwxr-xr-x | src/server/game/Globals/ObjectMgr.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index e93bd209fcd..d9fc0d9e012 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -903,7 +903,8 @@ void ObjectMgr::LoadCreatureAddons() uint32 guid = fields[0].GetUInt32(); - if (_creatureDataStore.find(guid) == _creatureDataStore.end()) + CreatureData const* creData = GetCreatureData(guid); + if (!creData) { sLog->outErrorDb("Creature (GUID: %u) does not exist but has a record in `creature_addon`", guid); continue; @@ -912,6 +913,12 @@ void ObjectMgr::LoadCreatureAddons() CreatureAddon& creatureAddon = _creatureAddonStore[guid]; creatureAddon.path_id = fields[1].GetUInt32(); + if (creData->movementType == WAYPOINT_MOTION_TYPE && !creatureAddon.path_id) + { + const_cast<CreatureData*>(creData)->movementType = IDLE_MOTION_TYPE; + sLog->outErrorDb("Creature (GUID %u) has movement type set to WAYPOINT_MOTION_TYPE but no path assigned", guid); + } + creatureAddon.mount = fields[2].GetUInt32(); creatureAddon.bytes1 = fields[3].GetUInt32(); creatureAddon.bytes2 = fields[4].GetUInt32(); |
