mirror of
https://github.com/EQEmu/Server.git
synced 2026-01-05 08:23:52 +00:00
Some more refactoring of hate_list
This commit is contained in:
parent
18f9a06f06
commit
4af3834715
@ -152,7 +152,7 @@ Mob* HateList::GetDamageTopOnHateList(Mob* hater)
|
||||
}
|
||||
|
||||
Mob* HateList::GetClosestEntOnHateList(Mob *hater) {
|
||||
Mob* close = nullptr;
|
||||
Mob* close_entity = nullptr;
|
||||
float close_distance = 99999.9f;
|
||||
float this_distance;
|
||||
|
||||
@ -161,15 +161,15 @@ Mob* HateList::GetClosestEntOnHateList(Mob *hater) {
|
||||
this_distance = (*iterator)->entity_on_hatelist->DistNoRootNoZ(*hater);
|
||||
if ((*iterator)->entity_on_hatelist != nullptr && this_distance <= close_distance) {
|
||||
close_distance = this_distance;
|
||||
close = (*iterator)->entity_on_hatelist;
|
||||
close_entity = (*iterator)->entity_on_hatelist;
|
||||
}
|
||||
++iterator;
|
||||
}
|
||||
|
||||
if ((!close && hater->IsNPC()) || (close && close->DivineAura()))
|
||||
close = hater->CastToNPC()->GetHateTop();
|
||||
if ((!close_entity && hater->IsNPC()) || (close_entity && close_entity->DivineAura()))
|
||||
close_entity = hater->CastToNPC()->GetHateTop();
|
||||
|
||||
return close;
|
||||
return close_entity;
|
||||
}
|
||||
|
||||
void HateList::AddEntToHateList(Mob *in_entity, int32 in_hate, int32 in_damage, bool in_is_entity_frenzied, bool iAddIfNotExist)
|
||||
|
||||
@ -28,7 +28,8 @@ struct ExtraAttackOptions;
|
||||
struct struct_HateList
|
||||
{
|
||||
Mob *entity_on_hatelist;
|
||||
int32 hatelist_damage, stored_hate_amount;
|
||||
int32 hatelist_damage;
|
||||
uint32 stored_hate_amount;
|
||||
bool is_entity_frenzy;
|
||||
};
|
||||
|
||||
@ -44,7 +45,7 @@ public:
|
||||
Mob *GetRandomEntOnHateList();
|
||||
Mob* GetEntWithMostHateOnList();
|
||||
|
||||
bool IsEntOnHateList(Mob *);
|
||||
bool IsEntOnHateList(Mob *mob);
|
||||
bool IsHateListEmpty();
|
||||
bool RemoveEntFromHateList(Mob *ent);
|
||||
|
||||
@ -60,7 +61,7 @@ public:
|
||||
void IsEntityInFrenzyMode();
|
||||
void PrintHateListToClient(Client *c);
|
||||
void SetHateAmountOnEnt(Mob *other, uint32 in_hate, uint32 in_damage);
|
||||
void SetOwner(Mob *new_hate_owner) { hate_owner = new_hate_owner; }
|
||||
void SetHateOwner(Mob *new_hate_owner) { hate_owner = new_hate_owner; }
|
||||
void SpellCast(Mob *caster, uint32 spell_id, float range, Mob *ae_center = nullptr);
|
||||
void WipeHateList();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user