[11808] Fix an old bug related to GO spawnmask check

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
Schmoozerd 2011-09-26 01:29:41 +02:00
parent 3567e69a3d
commit 241445aeeb
2 changed files with 13 additions and 14 deletions

View file

@ -1449,7 +1449,7 @@ void ObjectMgr::LoadGameObjects()
continue;
}
if(!gInfo->displayId)
if (!gInfo->displayId)
{
switch(gInfo->type)
{
@ -1481,9 +1481,16 @@ void ObjectMgr::LoadGameObjects()
data.rotation.z = fields[ 9].GetFloat();
data.rotation.w = fields[10].GetFloat();
data.spawntimesecs = fields[11].GetInt32();
data.animprogress = fields[12].GetUInt32();
uint32 go_state = fields[13].GetUInt32();
data.spawnMask = fields[14].GetUInt8();
data.phaseMask = fields[15].GetUInt16();
int16 gameEvent = fields[16].GetInt16();
int16 GuidPoolId = fields[17].GetInt16();
int16 EntryPoolId = fields[18].GetInt16();
MapEntry const* mapEntry = sMapStore.LookupEntry(data.mapid);
if(!mapEntry)
if (!mapEntry)
{
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) that spawned at nonexistent map (Id: %u), skip", guid, data.id, data.mapid);
continue;
@ -1497,9 +1504,6 @@ void ObjectMgr::LoadGameObjects()
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with `spawntimesecs` (0) value, but gameobejct marked as despawnable at action.", guid, data.id);
}
data.animprogress = fields[12].GetUInt32();
uint32 go_state = fields[13].GetUInt32();
if (go_state >= MAX_GO_STATE)
{
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with invalid `state` (%u) value, skip", guid, data.id, go_state);
@ -1507,12 +1511,6 @@ void ObjectMgr::LoadGameObjects()
}
data.go_state = GOState(go_state);
data.spawnMask = fields[14].GetUInt8();
data.phaseMask = fields[15].GetUInt16();
int16 gameEvent = fields[16].GetInt16();
int16 GuidPoolId = fields[17].GetInt16();
int16 EntryPoolId = fields[18].GetInt16();
if (data.rotation.x < -1.0f || data.rotation.x > 1.0f)
{
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with invalid rotation.x (%f) value, skip", guid, data.id, data.rotation.x);
@ -1537,13 +1535,13 @@ void ObjectMgr::LoadGameObjects()
continue;
}
if(!MapManager::IsValidMapCoord(data.mapid, data.posX, data.posY, data.posZ, data.orientation))
if (!MapManager::IsValidMapCoord(data.mapid, data.posX, data.posY, data.posZ, data.orientation))
{
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with invalid coordinates, skip", guid, data.id);
continue;
}
if(data.phaseMask == 0)
if (data.phaseMask == 0)
{
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with `phaseMask`=0 (not visible for anyone), set to 1.", guid, data.id);
data.phaseMask = 1;
@ -1551,6 +1549,7 @@ void ObjectMgr::LoadGameObjects()
if (gameEvent==0 && GuidPoolId==0 && EntryPoolId==0)// if not this is to be managed by GameEvent System or Pool system
AddGameobjectToGrid(guid, &data);
++count;
} while (result->NextRow());