feat(Core/Spells): improve SpellCheckRange(), spell cast when dismounting, falling or levitating spells (#3384)

This commit is contained in:
Stefano Borzì
2021-03-26 15:56:35 +01:00
committed by GitHub
parent 5a770d2945
commit b424273574
3 changed files with 127 additions and 53 deletions

View File

@@ -2862,10 +2862,10 @@ void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode
return;
}
target->SetCanFly(apply);
if (!apply && target->GetTypeId() == TYPEID_UNIT && !target->IsLevitating())
if (target->SetCanFly(apply) && !apply && !target->IsLevitating())
{
target->GetMotionMaster()->MoveFall();
}
}
void AuraEffect::HandleAuraWaterWalk(AuraApplication const* aurApp, uint8 mode, bool apply) const
@@ -3249,10 +3249,10 @@ void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp,
// do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
if (mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK && (apply || (!target->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !target->HasAuraType(SPELL_AURA_FLY))))
{
target->SetCanFly(apply);
if (!apply && target->GetTypeId() == TYPEID_UNIT && !target->IsLevitating())
if (target->SetCanFly(apply) && !apply && !target->IsLevitating())
{
target->GetMotionMaster()->MoveFall();
}
}
//! Someone should clean up these hacks and remove it from this function. It doesn't even belong here.