mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 00:18:43 +01:00
Core/Spell: fix an issue with vehicle spells changing orientation of base vehicle
Closes #17234
This commit is contained in:
@@ -15730,6 +15730,8 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
|
||||
{
|
||||
bool result = false;
|
||||
uint32 spellClickEntry = GetVehicleKit() ? GetVehicleKit()->GetCreatureEntry() : GetEntry();
|
||||
TriggerCastFlags const flags = GetVehicleKit() ? TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE : TRIGGERED_NONE;
|
||||
|
||||
SpellClickInfoMapBounds clickPair = sObjectMgr->GetSpellClickInfoMapBounds(spellClickEntry);
|
||||
for (SpellClickInfoContainer::const_iterator itr = clickPair.first; itr != clickPair.second; ++itr)
|
||||
{
|
||||
@@ -15769,7 +15771,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
|
||||
}
|
||||
|
||||
if (IsInMap(caster))
|
||||
caster->CastCustomSpell(itr->second.spellId, SpellValueMod(SPELLVALUE_BASE_POINT0+i), seatId + 1, target, GetVehicleKit() ? TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE : TRIGGERED_NONE, NULL, NULL, origCasterGUID);
|
||||
caster->CastCustomSpell(itr->second.spellId, SpellValueMod(SPELLVALUE_BASE_POINT0+i), seatId + 1, target, flags, NULL, NULL, origCasterGUID);
|
||||
else // This can happen during Player::_LoadAuras
|
||||
{
|
||||
int32 bp0[MAX_SPELL_EFFECTS];
|
||||
@@ -15783,7 +15785,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
|
||||
else
|
||||
{
|
||||
if (IsInMap(caster))
|
||||
caster->CastSpell(target, spellEntry, GetVehicleKit() ? TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE : TRIGGERED_NONE, NULL, NULL, origCasterGUID);
|
||||
caster->CastSpell(target, spellEntry, flags, NULL, NULL, origCasterGUID);
|
||||
else
|
||||
Aura::TryRefreshStackOrCreate(spellEntry, MAX_EFFECT_MASK, this, clicker, NULL, NULL, origCasterGUID);
|
||||
}
|
||||
|
||||
@@ -3034,6 +3034,10 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
if (spellInfo->Effects[j].IsAura(SPELL_AURA_SPELL_MAGNET))
|
||||
spellInfo->ProcFlags = 0;
|
||||
|
||||
// due to the way spell system works, unit would change orientation in Spell::_cast
|
||||
if (spellInfo->HasAura(SPELL_AURA_CONTROL_VEHICLE))
|
||||
spellInfo->AttributesEx5 |= SPELL_ATTR5_DONT_TURN_DURING_CAST;
|
||||
|
||||
if (spellInfo->ActiveIconID == 2158) // flight
|
||||
spellInfo->Attributes |= SPELL_ATTR0_PASSIVE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user