diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/Object.cpp | 5 | ||||
| -rw-r--r-- | src/game/SpellEffects.cpp | 17 |
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) |
