[11807] Add gameobject_addon table

table holds additional per-guid gameobject data.
currently it contains path rotation info that required for some elevators and transports
This commit is contained in:
SilverIce 2011-09-26 02:34:29 +03:00
parent 7a67f27ab3
commit 3567e69a3d
11 changed files with 93 additions and 16 deletions

View file

@ -130,9 +130,11 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa
SetObjectScale(goinfo->size);
SetWorldRotation(rotation.x,rotation.y,rotation.z,rotation.w);
// For most of gameobjects is (0, 0, 0, 1) quaternion, only transports has not standart rotation
// TODO: store these values in DB
SetTransportPathRotation(0, 0, 0, 1.f);
// For most of gameobjects is (0, 0, 0, 1) quaternion, only some transports has not standart rotation
if (const GameObjectDataAddon * addon = sGameObjectDataAddonStorage.LookupEntry<GameObjectDataAddon>(guidlow))
SetTransportPathRotation(addon->path_rotation);
else
SetTransportPathRotation(QuaternionData(0,0,0,1));
SetUInt32Value(GAMEOBJECT_FACTION, goinfo->faction);
SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags);
@ -1682,12 +1684,12 @@ void GameObject::SetWorldRotation(float qx, float qy, float qz, float qw)
m_worldRotation.w = rotation.w;
}
void GameObject::SetTransportPathRotation(float qx, float qy, float qz, float qw)
void GameObject::SetTransportPathRotation(QuaternionData rotation)
{
SetFloatValue(GAMEOBJECT_PARENTROTATION+0, qx);
SetFloatValue(GAMEOBJECT_PARENTROTATION+1, qy);
SetFloatValue(GAMEOBJECT_PARENTROTATION+2, qz);
SetFloatValue(GAMEOBJECT_PARENTROTATION+3, qw);
SetFloatValue(GAMEOBJECT_PARENTROTATION+0, rotation.x);
SetFloatValue(GAMEOBJECT_PARENTROTATION+1, rotation.y);
SetFloatValue(GAMEOBJECT_PARENTROTATION+2, rotation.z);
SetFloatValue(GAMEOBJECT_PARENTROTATION+3, rotation.w);
}
void GameObject::SetWorldRotationAngles(float z_rot, float y_rot, float x_rot)