Core/Vehicles:
- Send proper triggering flag when casting spellclick spells on vehicles (should not be fully triggered) - Only compute non-transport positions when not finalized. (Fixes changing seat on vehicles, or changing vehicle from vehicle)
This commit is contained in:
1 parent
6f38fb1011
commit
5eb22e5b64
4 files changed
+26
-17
No files matched your search
@@ -405,6 +405,7 @@ void Unit::UpdateSplineMovement(uint32 t_diff)
|
||||
pos.m_positionY = loc.y;
|
||||
pos.m_positionZ = loc.z;
|
||||
pos.m_orientation = loc.orientation;
|
||||
|
||||
if (Unit* vehicle = GetVehicleBase())
|
||||
{
|
||||
loc.x += vehicle->GetPositionX();
|
||||
@@ -861,17 +862,24 @@ void Unit::CastCustomSpell(Unit* target, uint32 spellId, int32 const* bp0, int32
|
||||
values.AddSpellMod(SPELLVALUE_BASE_POINT1, *bp1);
|
||||
if (bp2)
|
||||
values.AddSpellMod(SPELLVALUE_BASE_POINT2, *bp2);
|
||||
CastCustomSpell(spellId, values, target, triggered, castItem, triggeredByAura, originalCaster);
|
||||
CastCustomSpell(spellId, values, target, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster);
|
||||
}
|
||||
|
||||
void Unit::CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* target, bool triggered, Item* castItem, AuraEffect const* triggeredByAura, uint64 originalCaster)
|
||||
{
|
||||
CustomSpellValues values;
|
||||
values.AddSpellMod(mod, value);
|
||||
CastCustomSpell(spellId, values, target, triggered, castItem, triggeredByAura, originalCaster);
|
||||
CastCustomSpell(spellId, values, target, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster);
|
||||
}
|
||||
|
||||
void Unit::CastCustomSpell(uint32 spellId, CustomSpellValues const& value, Unit* victim, bool triggered, Item* castItem, AuraEffect const* triggeredByAura, uint64 originalCaster)
|
||||
void Unit::CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* target, TriggerCastFlags triggerFlags, Item* castItem, AuraEffect const* triggeredByAura, uint64 originalCaster)
|
||||
{
|
||||
CustomSpellValues values;
|
||||
values.AddSpellMod(mod, value);
|
||||
CastCustomSpell(spellId, values, target, triggerFlags, castItem, triggeredByAura, originalCaster);
|
||||
}
|
||||
|
||||
void Unit::CastCustomSpell(uint32 spellId, CustomSpellValues const& value, Unit* victim, TriggerCastFlags triggerFlags, Item* castItem, AuraEffect const* triggeredByAura, uint64 originalCaster)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
if (!spellInfo)
|
||||
@@ -882,7 +890,7 @@ void Unit::CastCustomSpell(uint32 spellId, CustomSpellValues const& value, Unit*
|
||||
SpellCastTargets targets;
|
||||
targets.SetUnitTarget(victim);
|
||||
|
||||
CastSpell(targets, spellInfo, &value, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster);
|
||||
CastSpell(targets, spellInfo, &value, triggerFlags, castItem, triggeredByAura, originalCaster);
|
||||
}
|
||||
|
||||
void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item* castItem, AuraEffect const* triggeredByAura, uint64 originalCaster)
|
||||
@@ -17011,7 +17019,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
|
||||
}
|
||||
|
||||
if (IsInMap(caster))
|
||||
caster->CastCustomSpell(itr->second.spellId, SpellValueMod(SPELLVALUE_BASE_POINT0+i), seatId+1, target, false, NULL, NULL, origCasterGUID);
|
||||
caster->CastCustomSpell(itr->second.spellId, SpellValueMod(SPELLVALUE_BASE_POINT0+i), seatId+1, target, GetVehicleKit() ? TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE : TRIGGERED_FULL_MASK, NULL, NULL, origCasterGUID);
|
||||
else // This can happen during Player::_LoadAuras
|
||||
{
|
||||
int32 bp0 = seatId;
|
||||
@@ -17021,7 +17029,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
|
||||
else
|
||||
{
|
||||
if (IsInMap(caster))
|
||||
caster->CastSpell(target, spellEntry, false, NULL, NULL, origCasterGUID);
|
||||
caster->CastSpell(target, spellEntry, GetVehicleKit() ? TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE : TRIGGERED_FULL_MASK, NULL, NULL, origCasterGUID);
|
||||
else
|
||||
Aura::TryRefreshStackOrCreate(spellEntry, MAX_EFFECT_MASK, this, clicker, NULL, NULL, origCasterGUID);
|
||||
}
|
||||
@@ -17041,7 +17049,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
|
||||
|
||||
void Unit::EnterVehicle(Unit* base, int8 seatId)
|
||||
{
|
||||
CastCustomSpell(VEHICLE_SPELL_RIDE_HARDCODED, SPELLVALUE_BASE_POINT0, seatId+1, base, false);
|
||||
CastCustomSpell(VEHICLE_SPELL_RIDE_HARDCODED, SPELLVALUE_BASE_POINT0, seatId+1, base, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
|
||||
}
|
||||
|
||||
void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* aurApp)
|
||||
|
||||
Reference in new issue
Block a user