Skip to content

Commit

Permalink
-Nowar fix: Bots now properly remove the at-war flag again with the '…
Browse files Browse the repository at this point in the history
…nowar' strategy.
  • Loading branch information
mostlikely4r committed Oct 4, 2024
1 parent 09b5a9f commit 4fdc890
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions playerbot/strategy/actions/CheckValuesAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,23 @@ bool CheckValuesAction::Execute(Event& event)
ReputationMgr& mgr = bot->GetReputationMgr();
for (auto & faction : mgr.GetStateList())
{
uint32 id = faction.first;
uint32 factionId = faction.second.ID;
uint32 replistId = faction.first;

if (!mgr.IsAtWar(id))
continue;
#ifdef MANGOSBOT_ZERO
const FactionEntry* thisFactionEntry = sFactionStore.LookupEntry(id);
#else
const FactionEntry* thisFactionEntry = sFactionStore.LookupEntry<FactionEntry>(id);
const FactionEntry* thisFactionEntry = sFactionStore.LookupEntry<FactionEntry>(factionId);
#endif

if (!mgr.IsAtWar(factionId))
continue;

if (!thisFactionEntry)
continue;

if (bot->GetReputationMgr().GetRank(thisFactionEntry) < REP_HOSTILE)
bot->GetReputationMgr().SetAtWar(id, false);
if (bot->GetReputationMgr().GetRank(thisFactionEntry) > REP_HATED)
bot->GetReputationMgr().SetAtWar(replistId, false);
}
}

Expand Down

0 comments on commit 4fdc890

Please sign in to comment.