From e07535c3e3b9df05c894557b675ccf95bf7a622b Mon Sep 17 00:00:00 2001 From: QAston Date: Thu, 15 Sep 2011 17:44:03 +0200 Subject: Core/Entities: Add new functions: Unit::GetReactionTo and Unit::GetFactionReactionTo for more direct reaction checks than Unit::IsFriendly/HostileTo (those functions have many duplicated code and have many checks unrelated to unit reaction). --- src/server/game/Reputation/ReputationMgr.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/server/game/Reputation/ReputationMgr.h') diff --git a/src/server/game/Reputation/ReputationMgr.h b/src/server/game/Reputation/ReputationMgr.h index bb22f46585a..59ec826f0c5 100755 --- a/src/server/game/Reputation/ReputationMgr.h +++ b/src/server/game/Reputation/ReputationMgr.h @@ -86,7 +86,7 @@ class ReputationMgr FactionState const* GetState(FactionEntry const* factionEntry) const { - return factionEntry->reputationListID >= 0 ? GetState(factionEntry->reputationListID) : NULL; + return factionEntry->CanHaveReputation() ? GetState(factionEntry->reputationListID) : NULL; } FactionState const* GetState(RepListID id) const @@ -95,6 +95,9 @@ class ReputationMgr return repItr != m_factions.end() ? &repItr->second : NULL; } + bool IsAtWar(uint32 faction_id) const; + bool IsAtWar(FactionEntry const* factionEntry) const; + int32 GetReputation(uint32 faction_id) const; int32 GetReputation(FactionEntry const* factionEntry) const; int32 GetBaseReputation(FactionEntry const* factionEntry) const; -- cgit v1.2.3