Implement FACTION_FLAG_SPECIAL(128) for home cities and their northrend representatives. Fixes bug that Alliance Vanguard rep updates were not sent to the client.
--HG-- branch : trunk
This commit is contained in:
@@ -112,9 +112,12 @@ uint32 ReputationMgr::GetDefaultStateFlags(FactionEntry const* factionEntry) con
|
||||
uint32 classMask = m_player->getClassMask();
|
||||
for (int i=0; i < 4; i++)
|
||||
{
|
||||
if( (factionEntry->BaseRepRaceMask[i] & raceMask) &&
|
||||
(factionEntry->BaseRepClassMask[i]==0 ||
|
||||
(factionEntry->BaseRepClassMask[i] & classMask) ) )
|
||||
if( (factionEntry->BaseRepRaceMask[i] & raceMask ||
|
||||
(factionEntry->BaseRepRaceMask[i] == 0 &&
|
||||
factionEntry->BaseRepClassMask[i] != 0 ) ) &&
|
||||
(factionEntry->BaseRepClassMask[i] & classMask ||
|
||||
factionEntry->BaseRepClassMask[i] == 0 )
|
||||
)
|
||||
return factionEntry->ReputationFlags[i];
|
||||
}
|
||||
return 0;
|
||||
@@ -199,7 +202,7 @@ void ReputationMgr::SendVisible(FactionState const* faction) const
|
||||
m_player->SendDirectMessage(&data);
|
||||
}
|
||||
|
||||
void ReputationMgr::Initilize()
|
||||
void ReputationMgr::Initialize()
|
||||
{
|
||||
m_factions.clear();
|
||||
m_visibleFactionCount = 0;
|
||||
@@ -372,7 +375,11 @@ void ReputationMgr::SetVisible(FactionEntry const *factionEntry)
|
||||
void ReputationMgr::SetVisible(FactionState* faction)
|
||||
{
|
||||
// always invisible or hidden faction can't be make visible
|
||||
if(faction->Flags & (FACTION_FLAG_INVISIBLE_FORCED|FACTION_FLAG_HIDDEN))
|
||||
// except if faction has FACTION_FLAG_SPECIAL
|
||||
if(faction->Flags & FACTION_FLAG_INVISIBLE_FORCED && !(faction->Flags & FACTION_FLAG_SPECIAL) )
|
||||
return;
|
||||
|
||||
if(faction->Flags & FACTION_FLAG_HIDDEN)
|
||||
return;
|
||||
|
||||
// already set
|
||||
@@ -448,7 +455,7 @@ void ReputationMgr::SetInactive(FactionState* faction, bool inactive)
|
||||
void ReputationMgr::LoadFromDB(QueryResult *result)
|
||||
{
|
||||
// Set initial reputations (so everything is nifty before DB data load)
|
||||
Initilize();
|
||||
Initialize();
|
||||
|
||||
//QueryResult *result = CharacterDatabase.PQuery("SELECT faction,standing,flags FROM character_reputation WHERE guid = '%u'",GetGUIDLow());
|
||||
|
||||
|
||||
@@ -39,7 +39,8 @@ enum FactionFlags
|
||||
FACTION_FLAG_INVISIBLE_FORCED = 0x08, // always overwrite FACTION_FLAG_VISIBLE and hide faction in rep.list, used for hide opposite team factions
|
||||
FACTION_FLAG_PEACE_FORCED = 0x10, // always overwrite FACTION_FLAG_AT_WAR, used for prevent war with own team factions
|
||||
FACTION_FLAG_INACTIVE = 0x20, // player controlled, state stored in characters.data ( CMSG_SET_FACTION_INACTIVE )
|
||||
FACTION_FLAG_RIVAL = 0x40 // flag for the two competing outland factions
|
||||
FACTION_FLAG_RIVAL = 0x40, // flag for the two competing outland factions
|
||||
FACTION_FLAG_SPECIAL = 0x80 // horde and alliance home cities and their northrend allies have this flag
|
||||
};
|
||||
|
||||
typedef uint32 RepListID;
|
||||
@@ -131,7 +132,7 @@ class ReputationMgr
|
||||
void SendStates() const;
|
||||
|
||||
private: // internal helper functions
|
||||
void Initilize();
|
||||
void Initialize();
|
||||
uint32 GetDefaultStateFlags(const FactionEntry *factionEntry) const;
|
||||
bool SetReputation(FactionEntry const* factionEntry, int32 standing, bool incremental);
|
||||
bool SetOneFactionReputation(FactionEntry const* factionEntry, int32 standing, bool incremental);
|
||||
|
||||
Reference in New Issue
Block a user