aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-08-19 23:01:56 -0500
committermegamage <none@none>2009-08-19 23:01:56 -0500
commit6169483d0f0959c813ad6302cfc9217306a8ef43 (patch)
tree6d49c2aa23e338b9fcc37e393273fc86c3831d10 /src
parent92f3d270272716c5a43f3916b0db042369808813 (diff)
*Set vehicle owner guid and faction in summonvehicle instead of spelleffecthandler.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Object.cpp5
-rw-r--r--src/game/SpellEffects.cpp17
2 files changed, 16 insertions, 6 deletions
diff --git a/src/game/Object.cpp b/src/game/Object.cpp
index 2e3aa8e0528..1d2aeabd132 100644
--- a/src/game/Object.cpp
+++ b/src/game/Object.cpp
@@ -1852,6 +1852,11 @@ Vehicle* WorldObject::SummonVehicle(uint32 entry, float x, float y, float z, flo
return NULL;
}
+ if(isType(TYPEMASK_UNIT))
+ {
+ v->SetUInt64Value(UNIT_FIELD_SUMMONEDBY, GetGUID());
+ v->setFaction(((Unit*)this)->getFaction());
+ }
map->Add((Creature*)v);
//ObjectAccessor::UpdateObjectVisibility(v);
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 911c75ca6b4..2cadd2262e6 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -3364,13 +3364,18 @@ void Spell::EffectSummonType(uint32 i)
case SUMMON_TYPE_VEHICLE:
case SUMMON_TYPE_VEHICLE2:
{
- Vehicle *vehicle = m_caster->SummonVehicle(entry, x, y, z, m_caster->GetOrientation());
+ if(!m_originalCaster)
+ return;
+
+ Vehicle *vehicle = m_originalCaster->SummonVehicle(entry, x, y, z, m_caster->GetOrientation());
if(!vehicle)
return;
- //vehicle->SetUInt64Value(UNIT_FIELD_SUMMONEDBY, m_caster->GetGUID());
- if(m_originalCaster)
- vehicle->setFaction(m_originalCaster->getFaction());
+ // 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);
+ //if(m_originalCaster)
+ // vehicle->setFaction(m_originalCaster->getFaction());
vehicle->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
break;
}
@@ -3463,8 +3468,8 @@ void Spell::EffectSummonType(uint32 i)
if(!vehicle)
return;
- vehicle->SetUInt64Value(UNIT_FIELD_SUMMONEDBY, m_caster->GetGUID());
- vehicle->setFaction(m_caster->getFaction());
+ //vehicle->SetUInt64Value(UNIT_FIELD_SUMMONEDBY, m_caster->GetGUID());
+ //vehicle->setFaction(m_caster->getFaction());
vehicle->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
if(damage)