Jump to content

[patch][6318] Combatstop()

Auntie Mangos

Recommended Posts

This patch adds and autorepeat cancel to Unit::CombatStop(). This will fix a problem with autorepeating spells (especially autoshot), keep on working after combat is finished (and endet by CombatStop()). This occures after duels, but also in other situations, like using this new command (http://getmangos.eu/community/viewtopic.php?id=27816) or e.g. when a mob chanes it's fraction during duell (-> friendly) what is the case in some scripted quests.

Rev 6313

Index: src/game/Unit.cpp
--- src/game/Unit.cpp                (revision 6313)
+++ src/game/Unit.cpp                (working copy)
@@ -8020,6 +8020,15 @@
                                RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PET_IN_COMBAT);

+void Unit::CombatStop() 
+                AttackStop(); 
+                if (GetTypeId()==TYPEID_PLAYER)
+                                ((Player*)this)->SendAttackSwingCancelAttack(); // force melee and autorepeat cancel
+                RemoveAllAttackers(); 
+                ClearInCombat(); 
bool Unit::isTargetableForAttack() const
                if (GetTypeId()==TYPEID_PLAYER && ((Player *)this)->isGameMaster())
Index: src/game/Unit.h
--- src/game/Unit.h                (revision 6313)
+++ src/game/Unit.h                (working copy)
@@ -724,7 +724,7 @@
                                AttackerSet const& getAttackers() const { return m_attackers; }
                                bool isAttackingPlayer() const;
                                Unit* getVictim() const { return m_attacking; }
-                                void CombatStop() { AttackStop(); RemoveAllAttackers(); ClearInCombat(); }
+                                void CombatStop();
                                Unit* SelectNearbyTarget() const;

                                void addUnitState(uint32 f) { m_state |= f; }



Link to comment
Share on other sites

  • 38 years later...
This topic is now closed to further replies.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use