Permalink
Browse files

Fix gameobject rotations. Closes #207

  • Loading branch information...
1 parent dec6c45 commit 8aad5257f00d7439b247e0536ff470180958f0d5 @Rochet2 Rochet2 committed Oct 11, 2016
Showing with 4 additions and 2 deletions.
  1. +2 −1 GlobalMethods.h
  2. +2 −1 WorldObjectMethods.h
View
@@ -1705,7 +1705,8 @@ namespace LuaGlobalFunctions
GameObject* object = new GameObject;
uint32 guidLow = map->GenerateLowGuid<HighGuid::GameObject>();
- if (!object->Create(guidLow, objectInfo->entry, map, phase, Position(x, y, z, o), G3D::Quat(), 0, GO_STATE_READY))
+ G3D::Quat rot = G3D::Matrix3::fromEulerAnglesZYX(o, 0.f, 0.f);
+ if (!object->Create(guidLow, objectInfo->entry, map, phase, Position(x, y, z, o), rot, 0, GO_STATE_READY))
{
delete object;
Eluna::Push(L);
@@ -682,7 +682,8 @@ namespace LuaWorldObject
#ifndef TRINITY
Eluna::Push(L, obj->SummonGameObject(entry, x, y, z, o, respawnDelay));
#else
- Eluna::Push(L, obj->SummonGameObject(entry, Position(x, y, z, o), G3D::Quat(), respawnDelay));
+ G3D::Quat rot = G3D::Matrix3::fromEulerAnglesZYX(o, 0.f, 0.f);
+ Eluna::Push(L, obj->SummonGameObject(entry, Position(x, y, z, o), rot, respawnDelay));
#endif
return 1;
}

0 comments on commit 8aad525

Please sign in to comment.