mirror of
https://github.com/mangosfour/server.git
synced 2025-12-27 10:37:02 +00:00
[11892] Really fix [11890]. This basicly reverts commit 11890
Remove the actually not required faction check in Player::GetNPCIfCanInteractWith - this is done by IsHostileTo a line before Improve the Player-login AtWar selection to also consider forced reactions Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
parent
85309aa3c1
commit
6aab5c1022
8 changed files with 70 additions and 61 deletions
|
|
@ -74,14 +74,8 @@ int32 ReputationMgr::GetReputation(FactionEntry const* factionEntry) const
|
|||
return 0;
|
||||
}
|
||||
|
||||
ReputationRank ReputationMgr::GetRank(FactionEntry const* factionEntry, bool withForcedReaction) const
|
||||
ReputationRank ReputationMgr::GetRank(FactionEntry const* factionEntry) const
|
||||
{
|
||||
if (withForcedReaction)
|
||||
{
|
||||
ForcedReactions::const_iterator find = m_forcedReactions.find(factionEntry->ID);
|
||||
if (find != m_forcedReactions.end())
|
||||
return find->second;
|
||||
}
|
||||
int32 reputation = GetReputation(factionEntry);
|
||||
return ReputationToRank(reputation);
|
||||
}
|
||||
|
|
@ -286,7 +280,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi
|
|||
{
|
||||
if (FactionEntry const *factionEntryCalc = sFactionStore.LookupEntry(*itr))
|
||||
{
|
||||
if (factionEntryCalc == factionEntry || GetRank(factionEntryCalc, false) > ReputationRank(factionEntryCalc->spilloverMaxRankIn))
|
||||
if (factionEntryCalc == factionEntry || GetRank(factionEntryCalc) > ReputationRank(factionEntryCalc->spilloverMaxRankIn))
|
||||
continue;
|
||||
int32 spilloverRep = int32(spillOverRepOut * factionEntryCalc->spilloverRateIn);
|
||||
if (spilloverRep != 0 || !incremental)
|
||||
|
|
@ -492,11 +486,17 @@ void ReputationMgr::LoadFromDB(QueryResult *result)
|
|||
}
|
||||
|
||||
// set atWar for hostile
|
||||
if(GetRank(factionEntry, true) <= REP_HOSTILE)
|
||||
SetAtWar(faction,true);
|
||||
ForcedReactions::const_iterator forceItr = m_forcedReactions.find(factionEntry->ID);
|
||||
if (forceItr != m_forcedReactions.end())
|
||||
{
|
||||
if (forceItr->second <= REP_HOSTILE)
|
||||
SetAtWar(faction, true);
|
||||
}
|
||||
else if (GetRank(factionEntry) <= REP_HOSTILE)
|
||||
SetAtWar(faction, true);
|
||||
|
||||
// reset changed flag if values similar to saved in DB
|
||||
if(faction->Flags==dbFactionFlags)
|
||||
if (faction->Flags == dbFactionFlags)
|
||||
{
|
||||
faction->needSend = false;
|
||||
faction->needSave = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue