[8697] Check creature/GO spawnmask at server loading.

Note: this check only out of range value in masks.
And not detect another possible DB problem:

After last client switch spawnmask for raid dengeons need update for correct work.
In expection same spawn for both normal or both heroic modes:
raid normal spawn mask from 1 to 3 (1|2)
raid heroic spawn mask from 2 to 12 (4|8)

In other case heroic spawn will used for 25-normal mode with empty heroic mode instances.
This commit is contained in:
VladimirMangos 2009-10-21 19:21:07 +04:00
parent 7ffb8e20ff
commit 314687092f
3 changed files with 67 additions and 3 deletions

View file

@ -1080,6 +1080,29 @@ void ObjectMgr::LoadCreatures()
int16 gameEvent = fields[18].GetInt16();
int16 PoolId = fields[19].GetInt16();
MapEntry const* mapEntry = sMapStore.LookupEntry(data.mapid);
if(!mapEntry)
{
sLog.outErrorDb("Table `creature` have creature (GUID: %u) that spawned at not existed map (Id: %u), skipped.",guid, data.mapid );
continue;
}
if(mapEntry->IsNonRaidDungeon())
{
if(data.spawnMask & ~SPAWNMASK_DUNGEON_ALL)
sLog.outErrorDb("Table `creature` have creature (GUID: %u) that have wrong spawn mask %u for non-raid dungeon map (Id: %u).",guid, data.spawnMask, data.mapid );
}
else if(mapEntry->IsRaid())
{
if(data.spawnMask & ~SPAWNMASK_RAID_ALL)
sLog.outErrorDb("Table `creature` have creature (GUID: %u) that have wrong spawn mask %u for raid dungeon map (Id: %u).",guid, data.spawnMask, data.mapid );
}
else
{
if(data.spawnMask & ~SPAWNMASK_CONTINENT)
sLog.outErrorDb("Table `creature` have creature (GUID: %u) that have wrong spawn mask %u for non-dungeon map (Id: %u).",guid, data.spawnMask, data.mapid );
}
if(heroicCreatures.find(data.id)!=heroicCreatures.end())
{
sLog.outErrorDb("Table `creature` have creature (GUID: %u) that listed as heroic template (entry: %u) in `creature_template`, skipped.",guid, data.id );
@ -1103,8 +1126,7 @@ void ObjectMgr::LoadCreatures()
if(cInfo->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND)
{
MapEntry const* map = sMapStore.LookupEntry(data.mapid);
if(!map || !map->IsDungeon())
if(!mapEntry || !mapEntry->IsDungeon())
sLog.outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `creature_template`.`flags_extra` including CREATURE_FLAG_EXTRA_INSTANCE_BIND but creature are not in instance.",guid,data.id);
}
@ -1259,6 +1281,29 @@ void ObjectMgr::LoadGameobjects()
data.rotation3 = fields[10].GetFloat();
data.spawntimesecs = fields[11].GetInt32();
MapEntry const* mapEntry = sMapStore.LookupEntry(data.mapid);
if(!mapEntry)
{
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) that spawned at not existed map (Id: %u), skip", guid, data.id, data.mapid);
continue;
}
if(mapEntry->IsNonRaidDungeon())
{
if(data.spawnMask & ~SPAWNMASK_DUNGEON_ALL)
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) that have wrong spawn mask %u for non-raid dungeon map (Id: %u), skip", guid, data.id, data.spawnMask, data.mapid);
}
else if(mapEntry->IsRaid())
{
if(data.spawnMask & ~SPAWNMASK_RAID_ALL)
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) that have wrong spawn mask %u for raid dungeon map (Id: %u), skip", guid, data.id, data.spawnMask, data.mapid);
}
else
{
if(data.spawnMask & ~SPAWNMASK_CONTINENT)
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) that have wrong spawn mask %u for non-dungeon map (Id: %u), skip", guid, data.id, data.spawnMask, data.mapid);
}
if (data.spawntimesecs == 0 && gInfo->IsDespawnAtAction())
{
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with `spawntimesecs` (0) value, but gameobejct marked as despawnable at action.", guid, data.id);