mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-22 12:18:27 +00:00
Changed hate counter to uint32 to prevent negative rollback, this most likely can will be an issue but more uncommon
Renamed and refactored most functions and variables in hate_list.h/cpp for readability Refactored how hate works in some local functions mixing the use of hate variable and split it out into different status variables hate_list.cpp/.h style cleanup hate_list.h header function sort, comment erase functions should clearly state their function
This commit is contained in:
+3
-3
@@ -1385,7 +1385,7 @@ void Merc::AI_Process() {
|
||||
rest_timer.Disable();
|
||||
|
||||
if(IsRooted())
|
||||
SetTarget(hate_list.GetClosest(this));
|
||||
SetTarget(hate_list.GetClosestEntOnHateList(this));
|
||||
else
|
||||
FindTarget();
|
||||
|
||||
@@ -2454,11 +2454,11 @@ void Merc::CheckHateList() {
|
||||
Mob* groupMember = g->members[counter];
|
||||
if(groupMember) {
|
||||
if(npc->IsOnHatelist(groupMember)) {
|
||||
if(!hate_list.IsOnHateList(npc)) {
|
||||
if(!hate_list.IsEntOnHateList(npc)) {
|
||||
float range = g->HasRole(groupMember, RolePuller) ? RuleI(Mercs, AggroRadiusPuller) : RuleI(Mercs, AggroRadius);
|
||||
range *= range;
|
||||
if(npc->DistNoRootNoZ(*this) < range) {
|
||||
hate_list.Add(npc, 1);
|
||||
hate_list.AddEntToHateList(npc, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user