mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
Added checking global cooldown for pet autocast spells.
Added checking global cooldown for pet spell casting triggered by master. Optimized PetAI::UpdateAI: - Removed obsolete victim_guid as combat check. - Stop pet combat when pet die in JustDied(Unit*) method. - Optimized autospells selection and casting. Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
parent
ca6e456da1
commit
8bea43063e
4 changed files with 106 additions and 104 deletions
|
|
@ -164,6 +164,9 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
|
|||
else
|
||||
unit_target = NULL;
|
||||
|
||||
if (((Creature*)pet)->GetGlobalCooldown() > 0)
|
||||
return;
|
||||
|
||||
// do not cast unknown spells
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellid );
|
||||
if(!spellInfo)
|
||||
|
|
@ -612,6 +615,9 @@ void WorldSession::HandlePetCastSpellOpcode( WorldPacket& recvPacket )
|
|||
return;
|
||||
}
|
||||
|
||||
if (pet->GetGlobalCooldown() > 0)
|
||||
return;
|
||||
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellid);
|
||||
if(!spellInfo)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue