aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2016-09-03 17:30:51 -0300
committerariel- <ariel-@users.noreply.github.com>2016-09-03 17:31:29 -0300
commit14445d2202de1b58dcb04c5457be682b8e7075ca (patch)
tree36ea2a96f62bc01450769890812d64a12ceb9e80 /src/server/scripts
parent7026c7ed7a39ae258eb0ba01f6946c8bc1594ce0 (diff)
Core/Misc: calculate rotation fields from orientation in some places it's impossible to get:
- SmartScripts: SMART_ACTION_SUMMON_GO - Spell Effects: * SPELL_EFFECT_DUEL * SPELL_EFFECT_SUMMON_OBJECT_WILD * SPELL_EFFECT_SUMMON_OBJECT_SLOT1 * SPELL_EFFECT_SUMMON_OBJECT_SLOT2 * SPELL_EFFECT_SUMMON_OBJECT_SLOT3 * SPELL_EFFECT_SUMMON_OBJECT_SLOT4 - Command Scripts: .gobject add Closes #17891
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Commands/cs_gobject.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp
index c4ed6f650b9..af58e9a1add 100644
--- a/src/server/scripts/Commands/cs_gobject.cpp
+++ b/src/server/scripts/Commands/cs_gobject.cpp
@@ -118,10 +118,9 @@ public:
if (!objectId)
return false;
- char* spawntimeSecs = strtok(NULL, " ");
-
- const GameObjectTemplate* objectInfo = sObjectMgr->GetGameObjectTemplate(objectId);
+ char* spawntimeSecs = strtok(nullptr, " ");
+ GameObjectTemplate const* objectInfo = sObjectMgr->GetGameObjectTemplate(objectId);
if (!objectInfo)
{
handler->PSendSysMessage(LANG_GAMEOBJECT_NOT_EXIST, objectId);
@@ -141,10 +140,11 @@ public:
Player* player = handler->GetSession()->GetPlayer();
Map* map = player->GetMap();
- GameObject* object = new GameObject;
+ GameObject* object = new GameObject();
ObjectGuid::LowType guidLow = map->GenerateLowGuid<HighGuid::GameObject>();
- if (!object->Create(guidLow, objectInfo->entry, map, player->GetPhaseMaskForSpawn(), *player, G3D::Quat(), 255, GO_STATE_READY))
+ G3D::Quat rot = G3D::Matrix3::fromEulerAnglesZYX(player->GetOrientation(), 0.f, 0.f);
+ if (!object->Create(guidLow, objectInfo->entry, map, player->GetPhaseMaskForSpawn(), *player, rot, 255, GO_STATE_READY))
{
delete object;
return false;