Core/Spells: Interrupt spells and auras before sending loot to client (#27279)

(cherry picked from commit a24ea431dc)
This commit is contained in:
acidmanifesto
2021-11-16 11:47:07 +01:00
committed by Shauren
parent 1b56e13e87
commit 29cf2a61af

View File

@@ -272,6 +272,12 @@ void WorldSession::HandleLootOpcode(WorldPackets::Loot::LootUnit& packet)
if (!GetPlayer()->IsAlive() || !packet.Unit.IsCreatureOrVehicle())
return;
// interrupt cast
if (GetPlayer()->IsNonMeleeSpellCast(false))
GetPlayer()->InterruptNonMeleeSpells(false);
GetPlayer()->RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags::Looting);
std::list<Creature*> corpses;
AELootCreatureCheck check(_player, packet.Unit);
Trinity::CreatureListSearcher<AELootCreatureCheck> searcher(_player, corpses, check);
@@ -293,12 +299,6 @@ void WorldSession::HandleLootOpcode(WorldPackets::Loot::LootUnit& packet)
SendPacket(WorldPackets::Loot::AELootTargetsAck().Write());
}
}
// interrupt cast
if (GetPlayer()->IsNonMeleeSpellCast(false))
GetPlayer()->InterruptNonMeleeSpells(false);
GetPlayer()->RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags::Looting);
}
void WorldSession::HandleLootReleaseOpcode(WorldPackets::Loot::LootRelease& packet)