mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
[Bug Fix] HasPet() Zone Crashes (#2744)
* [Bug Fixes] Fix for HasPet() Zone Crashes * HasPets const * Remove checking This * formatting
This commit is contained in:
@@ -529,6 +529,23 @@ Mob* Mob::GetPet() {
|
||||
return(tmp);
|
||||
}
|
||||
|
||||
bool Mob::HasPet() const {
|
||||
if (GetPetID() == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto m = entity_list.GetMob(GetPetID());
|
||||
if (!m) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m->GetOwnerID() != GetID()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Mob::SetPet(Mob* newpet) {
|
||||
Mob* oldpet = GetPet();
|
||||
if (oldpet) {
|
||||
|
||||
Reference in New Issue
Block a user