aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellEffects.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-08-24 12:54:36 -0500
committermegamage <none@none>2009-08-24 12:54:36 -0500
commita029ae15e597bc3a1b07aa5b8802a86201cb10fd (patch)
tree2bc409c69bb870354c71bb35f18d2d0e31431605 /src/game/SpellEffects.cpp
parent675cac9a6bfb2f64eca38152e6f4fb5ec79701e8 (diff)
*Fix some summon vehicle spells.
--HG-- branch : trunk
Diffstat (limited to 'src/game/SpellEffects.cpp')
-rw-r--r--src/game/SpellEffects.cpp28
1 files changed, 6 insertions, 22 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index d3a49bcba2e..a34ec67d9c9 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -3411,21 +3411,9 @@ void Spell::EffectSummonType(uint32 i)
break;
case SUMMON_TYPE_VEHICLE:
case SUMMON_TYPE_VEHICLE2:
- {
- if(!m_originalCaster)
- return;
-
- Creature *vehicle = m_originalCaster->SummonCreature(entry, x, y, z, 0, 0);
- if(!vehicle)
- return;
-
- // this is for wintergrasp, need to find a better way
- // in the future, we can just use getsummoner
- vehicle->SetUInt64Value(UNIT_FIELD_SUMMONEDBY, m_originalCasterGUID);
- vehicle->setFaction(m_originalCaster->getFaction());
- vehicle->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
+ if(m_originalCaster)
+ summon = m_caster->GetMap()->SummonCreature(entry, x, y, z, m_caster->GetOrientation(), 0, properties, duration, m_originalCaster);
break;
- }
case SUMMON_TYPE_TOTEM:
{
summon = m_caster->GetMap()->SummonCreature(entry, x, y, z, m_caster->GetOrientation(), 0, properties, duration, m_originalCaster);
@@ -3511,17 +3499,13 @@ void Spell::EffectSummonType(uint32 i)
{
float x, y, z;
m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE);
- Creature *vehicle = m_caster->SummonCreature(entry, x, y, z, m_caster->GetOrientation(), 0);
- if(!vehicle || !vehicle->IsVehicle())
+ summon = m_caster->GetMap()->SummonCreature(entry, x, y, z, m_caster->GetOrientation(), 0, properties, duration, m_caster);
+ if(!summon || !summon->IsVehicle())
return;
- vehicle->SetUInt64Value(UNIT_FIELD_SUMMONEDBY, m_caster->GetGUID());
- vehicle->setFaction(m_caster->getFaction());
- vehicle->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
-
if(damage)
- m_caster->CastSpell(vehicle, damage, true);
- m_caster->EnterVehicle(vehicle->GetVehicleKit());
+ m_caster->CastSpell(summon, damage, true);
+ m_caster->EnterVehicle(summon->GetVehicleKit());
break;
}
}