aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxinef1 <w.szyszko2@gmail.com>2017-02-05 22:24:23 +0100
committerShauren <shauren.trinity@gmail.com>2019-06-15 18:41:09 +0200
commit68cc366d88fd9cb4c759dc991568d994a29ba23e (patch)
tree5e41aca4f1e24a1b8aea6815e097f3345b787dd6
parent384f2d636cfd57c43ed88d5826f6c41a75391920 (diff)
Core/Spells: Corrected summon category SUMMON_CATEGORY_VEHICLE (#19052)
(cherrypicked from 227d5a9288db1200720444226320914ebcc8a216)
-rw-r--r--src/server/game/Spells/SpellEffects.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 08f6bfd0b98..c58bbedd4da 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -2120,12 +2120,19 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
// The spell that this effect will trigger. It has SPELL_AURA_CONTROL_VEHICLE
uint32 spellId = VEHICLE_SPELL_RIDE_HARDCODED;
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(effectInfo->CalcValue());
- if (spellInfo && spellInfo->HasAura(m_originalCaster->GetMap()->GetDifficultyID(), SPELL_AURA_CONTROL_VEHICLE))
- spellId = spellInfo->Id;
+ int32 basePoints = effectInfo->CalcValue();
+ if (basePoints > MAX_VEHICLE_SEATS)
+ {
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(basePoints);
+ if (spellInfo && spellInfo->HasAura(m_originalCaster->GetMap()->GetDifficultyID(), SPELL_AURA_CONTROL_VEHICLE))
+ spellId = spellInfo->Id;
+ }
- // Hard coded enter vehicle spell
- m_originalCaster->CastSpell(summon, spellId, true);
+ // if we have small value, it indicates seat position
+ if (basePoints > 0 && basePoints < MAX_VEHICLE_SEATS)
+ m_originalCaster->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, basePoints, summon, true);
+ else
+ m_originalCaster->CastSpell(summon, spellId, true);
uint32 faction = properties->Faction;
if (!faction)