mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
[11806] A bit gameobject code refactoring
This commit is contained in:
parent
8057f774e8
commit
7a67f27ab3
9 changed files with 63 additions and 60 deletions
|
|
@ -1476,10 +1476,10 @@ void ObjectMgr::LoadGameobjects()
|
|||
data.posY = fields[ 4].GetFloat();
|
||||
data.posZ = fields[ 5].GetFloat();
|
||||
data.orientation = fields[ 6].GetFloat();
|
||||
data.rotation0 = fields[ 7].GetFloat();
|
||||
data.rotation1 = fields[ 8].GetFloat();
|
||||
data.rotation2 = fields[ 9].GetFloat();
|
||||
data.rotation3 = fields[10].GetFloat();
|
||||
data.rotation.x = fields[ 7].GetFloat();
|
||||
data.rotation.y = fields[ 8].GetFloat();
|
||||
data.rotation.z = fields[ 9].GetFloat();
|
||||
data.rotation.w = fields[10].GetFloat();
|
||||
data.spawntimesecs = fields[11].GetInt32();
|
||||
|
||||
MapEntry const* mapEntry = sMapStore.LookupEntry(data.mapid);
|
||||
|
|
@ -1513,27 +1513,27 @@ void ObjectMgr::LoadGameobjects()
|
|||
int16 GuidPoolId = fields[17].GetInt16();
|
||||
int16 EntryPoolId = fields[18].GetInt16();
|
||||
|
||||
if (data.rotation0 < -1.0f || data.rotation0 > 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 rotation0 (%f) value, skip", guid, data.id, data.rotation0);
|
||||
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with invalid rotation.x (%f) value, skip", guid, data.id, data.rotation.x);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (data.rotation1 < -1.0f || data.rotation1 > 1.0f)
|
||||
if (data.rotation.y < -1.0f || data.rotation.y > 1.0f)
|
||||
{
|
||||
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with invalid rotation1 (%f) value, skip", guid, data.id, data.rotation1);
|
||||
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with invalid rotation.y (%f) value, skip", guid, data.id, data.rotation.y);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (data.rotation2 < -1.0f || data.rotation2 > 1.0f)
|
||||
if (data.rotation.z < -1.0f || data.rotation.z > 1.0f)
|
||||
{
|
||||
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with invalid rotation2 (%f) value, skip", guid, data.id, data.rotation2);
|
||||
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with invalid rotation.z (%f) value, skip", guid, data.id, data.rotation.z);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (data.rotation3 < -1.0f || data.rotation3 > 1.0f)
|
||||
if (data.rotation.w < -1.0f || data.rotation.w > 1.0f)
|
||||
{
|
||||
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with invalid rotation3 (%f) value, skip", guid, data.id, data.rotation3);
|
||||
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with invalid rotation.w (%f) value, skip", guid, data.id, data.rotation.w);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue