[Bug Fix] NPC Faction War prevention. (#3595)

* [Bug] NPC Faction War prevention.

This should assist with prevention of NPC Faction waring. I have been using this code on my server for over 5 years with no coredumps or any noted bugs. This was brought up as users have reported a few events where they can trigger NPC's to fight each other.

* Correct a few entries to line up with updated code.

* Re-add missing RestTimer functionality
This commit is contained in:
Fryguy
2023-11-19 11:40:15 -05:00
committed by GitHub
parent c0fe0f11f7
commit f7780b0247
7 changed files with 69 additions and 63 deletions
+8 -10
View File
@@ -4888,16 +4888,14 @@ bool Mob::RemoveFromHateList(Mob* mob)
return bFound;
}
void Mob::WipeHateList()
{
if(IsEngaged())
{
hate_list.WipeHateList();
AI_Event_NoLongerEngaged();
}
else
{
hate_list.WipeHateList();
void Mob::WipeHateList(bool npc_only) {
if (IsEngaged()) {
hate_list.WipeHateList(npc_only);
if (hate_list.IsHateListEmpty()) {
AI_Event_NoLongerEngaged();
}
} else {
hate_list.WipeHateList(npc_only);
}
}