mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 16:37:00 +00:00
[8811] check creature existance at waypoint loading
also just set the spellid to 0 if it doesn't exist instead of dorpping the whole movementpoint
This commit is contained in:
parent
25ab89ce97
commit
33c6241fd8
2 changed files with 13 additions and 4 deletions
|
|
@ -83,7 +83,10 @@ void WaypointManager::Load()
|
||||||
sLog.outString( ">> Paths loaded" );
|
sLog.outString( ">> Paths loaded" );
|
||||||
}
|
}
|
||||||
|
|
||||||
result = WorldDatabase.Query("SELECT position_x, position_y, position_z, orientation, model1, model2, waittime, emote, spell, textid1, textid2, textid3, textid4, textid5, id, point FROM creature_movement");
|
// 0 1 2 3 4 5
|
||||||
|
result = WorldDatabase.Query("SELECT position_x, position_y, position_z, orientation, model1, model2,"
|
||||||
|
// 6 7 8 9 10 11 12 13 14 15
|
||||||
|
"waittime, emote, spell, textid1, textid2, textid3, textid4, textid5, id, point FROM creature_movement");
|
||||||
|
|
||||||
barGoLink bar( result->GetRowCount() );
|
barGoLink bar( result->GetRowCount() );
|
||||||
do
|
do
|
||||||
|
|
@ -92,6 +95,12 @@ void WaypointManager::Load()
|
||||||
Field *fields = result->Fetch();
|
Field *fields = result->Fetch();
|
||||||
uint32 point = fields[15].GetUInt32();
|
uint32 point = fields[15].GetUInt32();
|
||||||
uint32 id = fields[14].GetUInt32();
|
uint32 id = fields[14].GetUInt32();
|
||||||
|
if (!sObjectMgr.GetCreatureData(id))
|
||||||
|
{
|
||||||
|
sLog.outErrorDb("Table creature_movement references unknown creature %u. Skipping.", id);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
WaypointPath &path = m_pathMap[id];
|
WaypointPath &path = m_pathMap[id];
|
||||||
// the cleanup queries make sure the following is true
|
// the cleanup queries make sure the following is true
|
||||||
assert(point >= 1 && point <= path.size());
|
assert(point >= 1 && point <= path.size());
|
||||||
|
|
@ -143,8 +152,8 @@ void WaypointManager::Load()
|
||||||
|
|
||||||
if (be.spell && ! sSpellStore.LookupEntry(be.spell))
|
if (be.spell && ! sSpellStore.LookupEntry(be.spell))
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Table creature_movement references unknown spellid %u. Skipping id %u.", be.spell, id);
|
sLog.outErrorDb("Table creature_movement references unknown spellid %u. Skipping id %u with point %u.", be.spell, id, point);
|
||||||
continue;
|
be.spell = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (be.emote)
|
if (be.emote)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8810"
|
#define REVISION_NR "8811"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue