mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 16:41:29 +00:00
bot.cpp was missing nullptr instead of NULL, that is now fixed.
hate_list.cpp potential crash fix related to center being nullptr
This commit is contained in:
parent
a4260e54fe
commit
a3f9d5e707
@ -16351,7 +16351,7 @@ void EntityList::ShowSpawnWindow(Client* client, int Distance, bool NamedOnly) {
|
|||||||
std::string WindowText;
|
std::string WindowText;
|
||||||
int LastCon = -1;
|
int LastCon = -1;
|
||||||
int CurrentCon = 0;
|
int CurrentCon = 0;
|
||||||
Mob* curMob = NULL;
|
Mob* curMob = nullptr;
|
||||||
|
|
||||||
uint32 array_counter = 0;
|
uint32 array_counter = 0;
|
||||||
|
|
||||||
|
|||||||
@ -268,6 +268,9 @@ Mob *HateList::GetTop(Mob *center)
|
|||||||
Mob* top = nullptr;
|
Mob* top = nullptr;
|
||||||
int32 hate = -1;
|
int32 hate = -1;
|
||||||
|
|
||||||
|
if(center == nullptr)
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
if (RuleB(Aggro,SmartAggroList)){
|
if (RuleB(Aggro,SmartAggroList)){
|
||||||
Mob* topClientTypeInRange = nullptr;
|
Mob* topClientTypeInRange = nullptr;
|
||||||
int32 hateClientTypeInRange = -1;
|
int32 hateClientTypeInRange = -1;
|
||||||
@ -380,15 +383,15 @@ Mob *HateList::GetTop(Mob *center)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!isTopClientType)
|
if(!isTopClientType)
|
||||||
return topClientTypeInRange;
|
return topClientTypeInRange ? topClientTypeInRange : nullptr;
|
||||||
|
|
||||||
return top;
|
return top ? top : nullptr;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(top == nullptr && skipped_count > 0) {
|
if(top == nullptr && skipped_count > 0) {
|
||||||
return center->GetTarget();
|
return center->GetTarget() ? center->GetTarget() : nullptr;
|
||||||
}
|
}
|
||||||
return top;
|
return top ? top : nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -413,10 +416,11 @@ Mob *HateList::GetTop(Mob *center)
|
|||||||
++iterator;
|
++iterator;
|
||||||
}
|
}
|
||||||
if(top == nullptr && skipped_count > 0) {
|
if(top == nullptr && skipped_count > 0) {
|
||||||
return center->GetTarget();
|
return center->GetTarget() ? center->GetTarget() : nullptr;
|
||||||
}
|
}
|
||||||
return top;
|
return top ? top : nullptr;
|
||||||
}
|
}
|
||||||
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
Mob *HateList::GetMostHate(){
|
Mob *HateList::GetMostHate(){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user