[Cleanup] Cleanup Owner Related Mob Methods (#3960)

* [Cleanup] Cleanup Owner Related Mob Methods

# Notes
- Cleanup `GetOwner()`, `GetOwnerOrSelf()`, `GetUltimateOwner()`, `HasOwner()`, and `IsPet()` methods.

* Update mob.cpp
This commit is contained in:
Alex King
2024-01-12 23:59:30 -05:00
committed by GitHub
parent 06e8d258e4
commit 6968a70310
2 changed files with 45 additions and 25 deletions
+3 -3
View File
@@ -1065,10 +1065,10 @@ public:
bool IsTargetLockPet() const { return type_of_pet == petTargetLock; }
inline uint32 GetPetTargetLockID() { return pet_targetlock_id; };
inline void SetPetTargetLockID(uint32 value) { pet_targetlock_id = value; };
void SetOwnerID(uint16 NewOwnerID);
void SetOwnerID(uint16 new_owner_id);
inline uint16 GetOwnerID() const { return ownerid; }
inline virtual bool HasOwner() { if(GetOwnerID()==0){return false;} return( entity_list.GetMob(GetOwnerID()) != 0); }
inline virtual bool IsPet() { return(HasOwner() && !IsMerc()); }
inline virtual bool HasOwner() { if (!GetOwnerID()){ return false; } return entity_list.GetMob(GetOwnerID()) != 0; }
inline virtual bool IsPet() { return HasOwner() && !IsMerc(); }
bool HasPet() const;
inline bool HasTempPetsActive() const { return(hasTempPet); }
inline void SetTempPetsActive(bool i) { hasTempPet = i; }