mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
[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:
@@ -1062,6 +1062,10 @@ void Mob::AI_Process() {
|
||||
SetTarget(hate_list.GetClosestEntOnHateList(this));
|
||||
else {
|
||||
if (AI_target_check_timer->Check()) {
|
||||
if (IsNPC() && (!IsPet() || (HasOwner() && GetOwner()->IsNPC())) && !CastToNPC()->WillAggroNPCs()) {
|
||||
WipeHateList(true); // wipe NPCs from hate list to prevent faction war
|
||||
}
|
||||
|
||||
if (IsFocused()) {
|
||||
if (!target) {
|
||||
SetTarget(hate_list.GetEntWithMostHateOnList(this));
|
||||
|
||||
Reference in New Issue
Block a user