mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[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:
parent
7ffb8e20ff
commit
314687092f
3 changed files with 67 additions and 3 deletions
|
|
@ -247,6 +247,25 @@ enum Difficulty
|
|||
#define MAX_RAID_DIFFICULTY 4
|
||||
#define MAX_DIFFICULTY 4
|
||||
|
||||
enum SpawnMask
|
||||
{
|
||||
SPAWNMASK_CONTINENT = 1, // any any maps without spawn modes
|
||||
|
||||
SPAWNMASK_DUNGEON_NORMAL = (1 << DUNGEON_DIFFICULTY_NORMAL),
|
||||
SPAWNMASK_DUNGEON_HEROIC = (1 << DUNGEON_DIFFICULTY_HEROIC),
|
||||
SPAWNMASK_DUNGEON_ALL = (SPAWNMASK_DUNGEON_NORMAL | SPAWNMASK_DUNGEON_HEROIC),
|
||||
|
||||
SPAWNMASK_RAID_10MAN_NORMAL = (1 << RAID_DIFFICULTY_10MAN_NORMAL),
|
||||
SPAWNMASK_RAID_25MAN_NORMAL = (1 << RAID_DIFFICULTY_25MAN_NORMAL),
|
||||
SPAWNMASK_RAID_NORMAL_ALL = (SPAWNMASK_RAID_10MAN_NORMAL | SPAWNMASK_RAID_25MAN_NORMAL),
|
||||
|
||||
SPAWNMASK_RAID_10MAN_HEROIC = (1 << RAID_DIFFICULTY_10MAN_HEROIC),
|
||||
SPAWNMASK_RAID_25MAN_HEROIC = (1 << RAID_DIFFICULTY_25MAN_HEROIC),
|
||||
SPAWNMASK_RAID_HEROIC_ALL = (SPAWNMASK_RAID_10MAN_HEROIC | SPAWNMASK_RAID_25MAN_HEROIC),
|
||||
|
||||
SPAWNMASK_RAID_ALL = (SPAWNMASK_RAID_NORMAL_ALL | SPAWNMASK_RAID_HEROIC_ALL),
|
||||
};
|
||||
|
||||
enum FactionTemplateFlags
|
||||
{
|
||||
FACTION_TEMPLATE_FLAG_CONTESTED_GUARD = 0x00001000, // faction will attack players that were involved in PvP combats
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "8696"
|
||||
#define REVISION_NR "8697"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue