mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
[Quest API] Add GetPet() to Perl (#3309)
# Perl - Add `$mob->GetPet()`. # Notes - This exists in Lua, but not Perl.
This commit is contained in:
+11
-10
@@ -406,21 +406,22 @@ bool ZoneDatabase::GetPoweredPetEntry(const char *pet_type, int16 petpower, PetR
|
||||
}
|
||||
|
||||
Mob* Mob::GetPet() {
|
||||
if(GetPetID() == 0)
|
||||
return(nullptr);
|
||||
|
||||
Mob* tmp = entity_list.GetMob(GetPetID());
|
||||
if(tmp == nullptr) {
|
||||
SetPetID(0);
|
||||
return(nullptr);
|
||||
if (!GetPetID()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if(tmp->GetOwnerID() != GetID()) {
|
||||
const auto m = entity_list.GetMob(GetPetID());
|
||||
if (!m) {
|
||||
SetPetID(0);
|
||||
return(nullptr);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return(tmp);
|
||||
if (m->GetOwnerID() != GetID()) {
|
||||
SetPetID(0);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
bool Mob::HasPet() const {
|
||||
|
||||
Reference in New Issue
Block a user