mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[11808] Fix an old bug related to GO spawnmask check
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
parent
3567e69a3d
commit
241445aeeb
2 changed files with 13 additions and 14 deletions
|
|
@ -1449,7 +1449,7 @@ void ObjectMgr::LoadGameObjects()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!gInfo->displayId)
|
if (!gInfo->displayId)
|
||||||
{
|
{
|
||||||
switch(gInfo->type)
|
switch(gInfo->type)
|
||||||
{
|
{
|
||||||
|
|
@ -1481,9 +1481,16 @@ void ObjectMgr::LoadGameObjects()
|
||||||
data.rotation.z = fields[ 9].GetFloat();
|
data.rotation.z = fields[ 9].GetFloat();
|
||||||
data.rotation.w = fields[10].GetFloat();
|
data.rotation.w = fields[10].GetFloat();
|
||||||
data.spawntimesecs = fields[11].GetInt32();
|
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);
|
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);
|
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) that spawned at nonexistent map (Id: %u), skip", guid, data.id, data.mapid);
|
||||||
continue;
|
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);
|
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)
|
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);
|
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.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)
|
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);
|
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;
|
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);
|
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with invalid coordinates, skip", guid, data.id);
|
||||||
continue;
|
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);
|
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;
|
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
|
if (gameEvent==0 && GuidPoolId==0 && EntryPoolId==0)// if not this is to be managed by GameEvent System or Pool system
|
||||||
AddGameobjectToGrid(guid, &data);
|
AddGameobjectToGrid(guid, &data);
|
||||||
|
|
||||||
++count;
|
++count;
|
||||||
|
|
||||||
} while (result->NextRow());
|
} while (result->NextRow());
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11807"
|
#define REVISION_NR "11808"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue