*Set vehicle owner guid and faction in summonvehicle instead of spelleffecthandler.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-19 23:01:56 -05:00
parent 92f3d27027
commit 6169483d0f
2 changed files with 16 additions and 6 deletions
+5
View File
@@ -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);
+11 -6
View File
@@ -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)