aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Combat/UnitEvents.h
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2016-10-06 23:14:51 -0300
committerjoschiwald <joschiwald.trinity@gmail.com>2017-08-21 21:49:36 +0200
commitec3dc0a43101dcbe2e469891acf0b654106eccfc (patch)
tree88f8c416d14b54fc5a71ba7f7cdb039aa66af44c /src/server/game/Combat/UnitEvents.h
parentab916fd1b37ca39071c2253be68e60ac2a735ada (diff)
Core/Misc: fix interaction of spells like Shadowmeld with Threat reducing effects
- SPELL_AURA_MOD_TOTAL_THREAT should be temporary and not added/subtracted from total, only computed - Cleanup of reference related code - Kill getLast() and reverse iterator obsevers, LinkedList iterator can't be used as a standard reverse_iterator (ie with operator++). They weren't used anyways (cherry picked from commit 3b6fd226bedb689847dadaeeba36a588ee9bc928) # Conflicts: # src/server/game/Combat/ThreatManager.cpp # src/server/game/Loot/LootMgr.h
Diffstat (limited to 'src/server/game/Combat/UnitEvents.h')
-rw-r--r--src/server/game/Combat/UnitEvents.h39
1 files changed, 13 insertions, 26 deletions
diff --git a/src/server/game/Combat/UnitEvents.h b/src/server/game/Combat/UnitEvents.h
index d8899ca49ab..35b7e7ecb5f 100644
--- a/src/server/game/Combat/UnitEvents.h
+++ b/src/server/game/Combat/UnitEvents.h
@@ -40,7 +40,7 @@ enum UNIT_EVENT_TYPE
UEV_THREAT_REF_REMOVE_FROM_LIST = 1<<2,
// Player/Pet entered/left water or some other place where it is/was not accessible for the creature
- UEV_THREAT_REF_ASSECCIBLE_STATUS = 1<<3,
+ UEV_THREAT_REF_ACCESSIBLE_STATUS = 1<<3,
// Threat list is going to be sorted (if dirty flag is set)
UEV_THREAT_SORT_LIST = 1<<4,
@@ -58,7 +58,7 @@ enum UNIT_EVENT_TYPE
//UEV_UNIT_HEALTH_CHANGE = 1<<8,
};
-#define UEV_THREAT_REF_EVENT_MASK (UEV_THREAT_REF_ONLINE_STATUS | UEV_THREAT_REF_THREAT_CHANGE | UEV_THREAT_REF_REMOVE_FROM_LIST | UEV_THREAT_REF_ASSECCIBLE_STATUS)
+#define UEV_THREAT_REF_EVENT_MASK (UEV_THREAT_REF_ONLINE_STATUS | UEV_THREAT_REF_THREAT_CHANGE | UEV_THREAT_REF_REMOVE_FROM_LIST | UEV_THREAT_REF_ACCESSIBLE_STATUS)
#define UEV_THREAT_MANAGER_EVENT_MASK (UEV_THREAT_SORT_LIST | UEV_THREAT_SET_NEXT_TARGET | UEV_THREAT_VICTIM_CHANGED)
#define UEV_ALL_EVENT_MASK (0xffffffff)
@@ -69,14 +69,16 @@ enum UNIT_EVENT_TYPE
class UnitBaseEvent
{
- private:
- uint32 iType;
public:
- UnitBaseEvent(uint32 pType) { iType = pType; }
+ explicit UnitBaseEvent(uint32 pType) { iType = pType; }
uint32 getType() const { return iType; }
bool matchesTypeMask(uint32 pMask) const { return (iType & pMask) != 0; }
- void setType(uint32 pType) { iType = pType; }
+ private:
+ uint32 iType;
+
+ protected:
+ ~UnitBaseEvent() { }
};
//==============================================================
@@ -92,14 +94,15 @@ class TC_GAME_API ThreatRefStatusChangeEvent : public UnitBaseEvent
bool iBValue;
};
ThreatManager* iThreatManager;
+
public:
- ThreatRefStatusChangeEvent(uint32 pType) : UnitBaseEvent(pType), iThreatManager(NULL) { iHostileReference = NULL; }
+ explicit ThreatRefStatusChangeEvent(uint32 pType) : UnitBaseEvent(pType), iHostileReference(nullptr), iThreatManager(nullptr) { }
- ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference) : UnitBaseEvent(pType), iThreatManager(NULL) { iHostileReference = pHostileReference; }
+ ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference) : UnitBaseEvent(pType), iHostileReference(pHostileReference), iThreatManager(nullptr) { }
- ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference, float pValue) : UnitBaseEvent(pType), iThreatManager(NULL) { iHostileReference = pHostileReference; iFValue = pValue; }
+ ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference, float pValue) : UnitBaseEvent(pType), iHostileReference(pHostileReference), iFValue(pValue), iThreatManager(nullptr) { }
- ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference, bool pValue) : UnitBaseEvent(pType), iThreatManager(NULL) { iHostileReference = pHostileReference; iBValue = pValue; }
+ ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference, bool pValue) : UnitBaseEvent(pType), iHostileReference(pHostileReference), iBValue(pValue), iThreatManager(nullptr) { }
int32 getIValue() const { return iIValue; }
@@ -116,20 +119,4 @@ class TC_GAME_API ThreatRefStatusChangeEvent : public UnitBaseEvent
ThreatManager* getThreatManager() const { return iThreatManager; }
};
-//==============================================================
-
-class ThreatManagerEvent : public ThreatRefStatusChangeEvent
-{
- private:
- ThreatContainer* iThreatContainer;
- public:
- ThreatManagerEvent(uint32 pType) : ThreatRefStatusChangeEvent(pType), iThreatContainer(NULL) { }
- ThreatManagerEvent(uint32 pType, HostileReference* pHostileReference) : ThreatRefStatusChangeEvent(pType, pHostileReference), iThreatContainer(NULL) { }
-
- void setThreatContainer(ThreatContainer* pThreatContainer) { iThreatContainer = pThreatContainer; }
-
- ThreatContainer* getThreatContainer() const { return iThreatContainer; }
-};
-
-//==============================================================
#endif