aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2016-09-03 22:30:51 +0200
committerjoschiwald <joschiwald.trinity@gmail.com>2017-02-19 15:34:57 +0100
commitb239afb0ef3086020637f43c8a48a38eef6b9fee (patch)
tree28374e0ed9a7d739be78a94045ff5e00ffb15336 /src/server/game/Spells
parentdd0df772df4603b95dc133dc9b896e5fc8e3bdf8 (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 (cherry picked from commit 14445d2202de1b58dcb04c5457be682b8e7075ca)
Diffstat (limited to 'src/server/game/Spells')
-rw-r--r--src/server/game/Spells/SpellEffects.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 378721b83ff..6067e435539 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -3151,7 +3151,7 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex)
uint32 gameobject_id = effectInfo->MiscValue;
- GameObject* pGameObj = new GameObject;
+ GameObject* pGameObj = new GameObject();
WorldObject* target = focusObject;
if (!target)
@@ -3165,7 +3165,8 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex)
Map* map = target->GetMap();
- if (!pGameObj->Create(gameobject_id, map, m_caster->GetPhaseMask(), Position(x, y, z, target->GetOrientation()), G3D::Quat(), 255, GO_STATE_READY))
+ G3D::Quat rot = G3D::Matrix3::fromEulerAnglesZYX(target->GetOrientation(), 0.f, 0.f);
+ if (!pGameObj->Create(gameobject_id, map, m_caster->GetPhaseMask(), Position(x, y, z, target->GetOrientation()), rot, 255, GO_STATE_READY))
{
delete pGameObj;
return;
@@ -3190,8 +3191,8 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex)
if (uint32 linkedEntry = pGameObj->GetGOInfo()->GetLinkedGameObjectEntry())
{
- GameObject* linkedGO = new GameObject;
- if (linkedGO->Create(linkedEntry, map, m_caster->GetPhaseMask(), Position(x, y, z, target->GetOrientation()), G3D::Quat(), 255, GO_STATE_READY))
+ GameObject* linkedGO = new GameObject();
+ if (linkedGO->Create(linkedEntry, map, m_caster->GetPhaseMask(), Position(x, y, z, target->GetOrientation()), rot, 255, GO_STATE_READY))
{
linkedGO->CopyPhaseFrom(m_caster);
@@ -3204,11 +3205,7 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex)
map->AddToMap(linkedGO);
}
else
- {
delete linkedGO;
- linkedGO = NULL;
- return;
- }
}
}
@@ -3793,7 +3790,8 @@ void Spell::EffectDuel(SpellEffIndex effIndex)
};
Map* map = m_caster->GetMap();
- if (!pGameObj->Create(gameobject_id, map, m_caster->GetPhaseMask(), pos, G3D::Quat(), 0, GO_STATE_READY))
+ G3D::Quat rot = G3D::Matrix3::fromEulerAnglesZYX(pos.GetOrientation(), 0.f, 0.f);
+ if (!pGameObj->Create(gameobject_id, map, m_caster->GetPhaseMask(), pos, rot, 0, GO_STATE_READY))
{
delete pGameObj;
return;
@@ -4128,7 +4126,8 @@ void Spell::EffectSummonObject(SpellEffIndex effIndex)
m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE);
Map* map = m_caster->GetMap();
- if (!go->Create(go_id, map, m_caster->GetPhaseMask(), Position(x, y, z, m_caster->GetOrientation()), G3D::Quat(), 255, GO_STATE_READY))
+ G3D::Quat rot = G3D::Matrix3::fromEulerAnglesZYX(m_caster->GetOrientation(), 0.f, 0.f);
+ if (!go->Create(go_id, map, m_caster->GetPhaseMask(), Position(x, y, z, m_caster->GetOrientation()), rot, 255, GO_STATE_READY))
{
delete go;
return;