From 5ef916a7d0795c524eab4d86694418ed7811a978 Mon Sep 17 00:00:00 2001 From: Olion Date: Wed, 6 Dec 2017 21:30:36 +0200 Subject: [PATCH] ReputationMgr: set and clear AtWar flag appropriately --- src/game/Object/ReputationMgr.cpp | 15 ++++++++------- src/shared/revision.h | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/game/Object/ReputationMgr.cpp b/src/game/Object/ReputationMgr.cpp index 058bf795..54187c77 100644 --- a/src/game/Object/ReputationMgr.cpp +++ b/src/game/Object/ReputationMgr.cpp @@ -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; } diff --git a/src/shared/revision.h b/src/shared/revision.h index fe056072..31264439 100644 --- a/src/shared/revision.h +++ b/src/shared/revision.h @@ -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__