[8698] Better way check spawn masks (for specific map)

Also note: i has been totaly wrong in my last notes in prev. commit :((
Old "heroic raid" fine map to new normal 25. Sorry.
This commit is contained in:
VladimirMangos 2009-10-21 21:07:13 +04:00
parent 314687092f
commit ffc2f97d3b
2 changed files with 21 additions and 31 deletions

View file

@ -1041,6 +1041,14 @@ void ObjectMgr::LoadCreatures()
if(cInfo->HeroicEntry)
heroicCreatures.insert(cInfo->HeroicEntry);
// build single time for check spawnmask
std::map<uint32,uint32> spawnMasks;
for(uint32 i = 0; i < sMapStore.GetNumRows(); ++i)
if(sMapStore.LookupEntry(i))
for(int k = 0; k < MAX_DIFFICULTY; ++k)
if (GetMapDifficultyData(i,Difficulty(k)))
spawnMasks[i] |= (1 << k);
barGoLink bar(result->GetRowCount());
do
@ -1087,21 +1095,8 @@ void ObjectMgr::LoadCreatures()
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 (data.spawnMask & ~spawnMasks[data.mapid])
sLog.outErrorDb("Table `creature` have creature (GUID: %u) that have wrong spawn mask %u including not supported difficulty modes for map (Id: %u).",guid, data.spawnMask, data.mapid );
if(heroicCreatures.find(data.id)!=heroicCreatures.end())
{
@ -1231,6 +1226,14 @@ void ObjectMgr::LoadGameobjects()
return;
}
// build single time for check spawnmask
std::map<uint32,uint32> spawnMasks;
for(uint32 i = 0; i < sMapStore.GetNumRows(); ++i)
if(sMapStore.LookupEntry(i))
for(int k = 0; k < MAX_DIFFICULTY; ++k)
if (GetMapDifficultyData(i,Difficulty(k)))
spawnMasks[i] |= (1 << k);
barGoLink bar(result->GetRowCount());
do
@ -1288,21 +1291,8 @@ void ObjectMgr::LoadGameobjects()
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.spawnMask & ~spawnMasks[data.mapid])
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) that have wrong spawn mask %u including not supported difficulty modes for map (Id: %u), skip", guid, data.id, data.spawnMask, data.mapid);
if (data.spawntimesecs == 0 && gInfo->IsDespawnAtAction())
{