mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 13:28:25 +00:00
[Crash] Add Checks for valid pointers or fix existing. (#3164)
This commit is contained in:
+31
-26
@@ -483,20 +483,22 @@ Mob *HateList::GetEntWithMostHateOnList(Mob *center, Mob *skip, bool skip_mezzed
|
||||
while (iterator != list.end())
|
||||
{
|
||||
struct_HateList *cur = (*iterator);
|
||||
if (cur->entity_on_hatelist == skip) {
|
||||
++iterator;
|
||||
continue;
|
||||
}
|
||||
if (cur) {
|
||||
if (cur->entity_on_hatelist == skip) {
|
||||
++iterator;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (skip_mezzed && cur->entity_on_hatelist->IsMezzed()) {
|
||||
++iterator;
|
||||
continue;
|
||||
}
|
||||
if (skip_mezzed && cur->entity_on_hatelist->IsMezzed()) {
|
||||
++iterator;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (cur->entity_on_hatelist != nullptr && ((cur->stored_hate_amount > hate) || cur->is_entity_frenzy))
|
||||
{
|
||||
top_hate = cur->entity_on_hatelist;
|
||||
hate = cur->stored_hate_amount;
|
||||
if (cur->entity_on_hatelist != nullptr && ((cur->stored_hate_amount > hate) || cur->is_entity_frenzy))
|
||||
{
|
||||
top_hate = cur->entity_on_hatelist;
|
||||
hate = cur->stored_hate_amount;
|
||||
}
|
||||
}
|
||||
++iterator;
|
||||
}
|
||||
@@ -516,24 +518,27 @@ Mob *HateList::GetEntWithMostHateOnList(bool skip_mezzed){
|
||||
while (iterator != list.end())
|
||||
{
|
||||
struct_HateList *cur = (*iterator);
|
||||
LogHateDetail(
|
||||
"Looping GetEntWithMostHateOnList1 [{}] cur [{}] hate [{}] calc [{}]",
|
||||
cur->entity_on_hatelist->GetMobDescription(),
|
||||
cur->stored_hate_amount,
|
||||
hate,
|
||||
(cur->stored_hate_amount > hate)
|
||||
);
|
||||
|
||||
if (cur && cur->entity_on_hatelist != nullptr && (cur->stored_hate_amount > hate))
|
||||
{
|
||||
if (cur) {
|
||||
LogHateDetail(
|
||||
"Looping GetEntWithMostHateOnList2 [{}]",
|
||||
cur->entity_on_hatelist->GetMobDescription()
|
||||
"Looping GetEntWithMostHateOnList1 [{}] cur [{}] hate [{}] calc [{}]",
|
||||
cur->entity_on_hatelist->GetMobDescription(),
|
||||
cur->stored_hate_amount,
|
||||
hate,
|
||||
(cur->stored_hate_amount > hate)
|
||||
);
|
||||
|
||||
if (!skip_mezzed || !cur->entity_on_hatelist->IsMezzed()) {
|
||||
top = cur->entity_on_hatelist;
|
||||
hate = cur->stored_hate_amount;
|
||||
if (cur->entity_on_hatelist != nullptr && (cur->stored_hate_amount > hate))
|
||||
{
|
||||
LogHateDetail(
|
||||
"Looping GetEntWithMostHateOnList2 [{}]",
|
||||
cur->entity_on_hatelist->GetMobDescription()
|
||||
);
|
||||
|
||||
if (!skip_mezzed || !cur->entity_on_hatelist->IsMezzed()) {
|
||||
top = cur->entity_on_hatelist;
|
||||
hate = cur->stored_hate_amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
++iterator;
|
||||
|
||||
Reference in New Issue
Block a user