ReputationMgr: set and clear AtWar flag appropriately

This commit is contained in:
Olion 2017-12-06 21:30:36 +02:00 committed by Antz
parent 820a017eaf
commit 5ef916a7d0
2 changed files with 10 additions and 9 deletions

View File

@ -293,8 +293,9 @@ bool ReputationMgr::SetOneFactionReputation(FactionEntry const* factionEntry, in
SetVisible(&faction);
if (ReputationToRank(standing) <= REP_HOSTILE)
{ SetAtWar(&itr->second, true); }
// check and, if needed, modify AtWar flag every rep rank crossing
if (ReputationToRank(standing) != ReputationToRank(BaseRep))
SetAtWar(&itr->second, ReputationToRank(standing) <= REP_HOSTILE);
m_player->ReputationChanged(factionEntry);
@ -369,12 +370,12 @@ void ReputationMgr::SetAtWar(FactionState* faction, bool atWar)
else
{ faction->Flags &= ~FACTION_FLAG_AT_WAR; }
WorldPacket data(SMSG_SET_FACTION_ATWAR, 4 + 1);
data << uint32(faction->ID);
data << uint8(faction->Flags & FACTION_FLAG_AT_WAR); // the client tests only FACTION_FLAG_AT_WAR
m_player->SendDirectMessage(&data);
//WorldPacket data(SMSG_SET_FACTION_ATWAR, 4 + 1);
//data << uint32(faction->ID);
//data << uint8(faction->Flags & FACTION_FLAG_AT_WAR); // the client tests only FACTION_FLAG_AT_WAR
//m_player->SendDirectMessage(&data);
faction->needSend = false;
faction->needSend = true;
faction->needSave = true;
}

View File

@ -38,6 +38,6 @@
#define WORLD_DB_VERSION_NR 21
#define WORLD_DB_STRUCTURE_NR 14
#define WORLD_DB_CONTENT_NR 67
#define WORLD_DB_UPDATE_DESCRIPTION "kodo roundup tidyup"
#define WORLD_DB_CONTENT_NR 77
#define WORLD_DB_UPDATE_DESCRIPTION "lower_npc_text_id"
#endif // __REVISION_H__