mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
[10336] Server side checks for casting non-combat spells in combat.
Interrupt casting non combat spell spell at neter to combat and prevent it casting in combat (last checked by client but better recheck at server for prevent cheating).
This commit is contained in:
parent
7e251dd408
commit
085811fc06
3 changed files with 15 additions and 6 deletions
|
|
@ -7457,6 +7457,12 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy)
|
|||
if (isCharmed() || (GetTypeId()!=TYPEID_PLAYER && ((Creature*)this)->isPet()))
|
||||
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PET_IN_COMBAT);
|
||||
|
||||
// interrupt all delayed non-combat casts
|
||||
for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; ++i)
|
||||
if (Spell* spell = GetCurrentSpell(CurrentSpellTypes(i)))
|
||||
if (IsNonCombatSpell(spell->m_spellInfo))
|
||||
InterruptSpell(CurrentSpellTypes(i),false);
|
||||
|
||||
if (creatureNotInCombat)
|
||||
{
|
||||
// should probably be removed for the attacked (+ it's party/group) only, not global
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue