From 8aad5257f00d7439b247e0536ff470180958f0d5 Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Tue, 11 Oct 2016 21:17:47 +0300 Subject: [PATCH] Fix gameobject rotations. Closes https://github.com/ElunaLuaEngine/Eluna/issues/207 --- GlobalMethods.h | 3 ++- WorldObjectMethods.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/GlobalMethods.h b/GlobalMethods.h index 12f52e1..cb2d835 100644 --- a/GlobalMethods.h +++ b/GlobalMethods.h @@ -1705,7 +1705,8 @@ namespace LuaGlobalFunctions GameObject* object = new GameObject; uint32 guidLow = map->GenerateLowGuid(); - 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); diff --git a/WorldObjectMethods.h b/WorldObjectMethods.h index de3c826..dd9d9eb 100644 --- a/WorldObjectMethods.h +++ b/WorldObjectMethods.h @@ -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; }