diff --git a/zone/entity.cpp b/zone/entity.cpp index cc531ca38..f79409249 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -2999,7 +2999,7 @@ void EntityList::Depop(bool StartSpawnTimer) if (own && own->IsClient()) continue; - if (pnpc->IsHorse) + if (pnpc->IsHorse()) continue; if (pnpc->IsFindable()) diff --git a/zone/horse.cpp b/zone/horse.cpp index 0a23995ad..a31c58901 100644 --- a/zone/horse.cpp +++ b/zone/horse.cpp @@ -36,7 +36,7 @@ Horse::Horse(Client *_owner, uint16 spell_id, const glm::vec4& position) strn0cpy(name, _owner->GetCleanName(), 55); strcat(name,"`s_Mount00"); - IsHorse = true; + is_horse = true; owner = _owner; } diff --git a/zone/lua_mob.cpp b/zone/lua_mob.cpp index 600851698..9b3c12204 100644 --- a/zone/lua_mob.cpp +++ b/zone/lua_mob.cpp @@ -2309,6 +2309,12 @@ void Lua_Mob::SetBucket(std::string bucket_name, std::string bucket_value, std:: self->SetBucket(bucket_name, bucket_value, expiration); } +bool Lua_Mob::IsHorse() +{ + Lua_Safe_Call_Bool(); + return self->IsHorse(); +} + luabind::scope lua_register_mob() { return luabind::class_("Mob") .def(luabind::constructor<>()) @@ -2706,7 +2712,8 @@ luabind::scope lua_register_mob() { .def("GetBucketKey", (std::string(Lua_Mob::*)(void))&Lua_Mob::GetBucketKey) .def("GetBucketRemaining", (std::string(Lua_Mob::*)(std::string))&Lua_Mob::GetBucketRemaining) .def("SetBucket", (void(Lua_Mob::*)(std::string,std::string))&Lua_Mob::SetBucket) - .def("SetBucket", (void(Lua_Mob::*)(std::string,std::string,std::string))&Lua_Mob::SetBucket); + .def("SetBucket", (void(Lua_Mob::*)(std::string,std::string,std::string))&Lua_Mob::SetBucket) + .def("IsHorse", &Lua_Mob::IsHorse); } luabind::scope lua_register_special_abilities() { diff --git a/zone/lua_mob.h b/zone/lua_mob.h index d2994f669..396bdd62e 100644 --- a/zone/lua_mob.h +++ b/zone/lua_mob.h @@ -433,6 +433,7 @@ public: std::string GetBucketRemaining(std::string bucket_name); void SetBucket(std::string bucket_name, std::string bucket_value); void SetBucket(std::string bucket_name, std::string bucket_value, std::string expiration); + bool IsHorse(); }; #endif diff --git a/zone/mob.cpp b/zone/mob.cpp index 751d4d445..853096592 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -313,7 +313,7 @@ Mob::Mob( isgrouped = false; israidgrouped = false; - IsHorse = false; + is_horse = false; entity_id_being_looted = 0; _appearance = eaStanding; diff --git a/zone/mob.h b/zone/mob.h index 69f487c5d..6dd27b223 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -901,6 +901,7 @@ public: inline void SetPetOwnerClient(bool value) { pet_owner_client = value; } inline bool IsTempPet() const { return _IsTempPet; } inline void SetTempPet(bool value) { _IsTempPet = value; } + inline bool IsHorse() { return is_horse; } inline const bodyType GetBodyType() const { return bodytype; } inline const bodyType GetOrigBodyType() const { return orig_bodytype; } @@ -1591,8 +1592,8 @@ protected: std::unordered_map> aa_ranks; Timer aa_timers[aaTimerMax]; - - bool IsHorse; + + bool is_horse; AuraMgr aura_mgr; AuraMgr trap_mgr; diff --git a/zone/perl_mob.cpp b/zone/perl_mob.cpp index 5e5f7981b..7d27d5b27 100644 --- a/zone/perl_mob.cpp +++ b/zone/perl_mob.cpp @@ -6179,6 +6179,21 @@ XS(XS_Mob_SetBucket) { XSRETURN_EMPTY; } +XS(XS_Mob_IsHorse); +XS(XS_Mob_IsHorse) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Mob::IsHorse(THIS)"); // @categories Script Utility + { + Mob *THIS; + bool RETVAL; + VALIDATE_THIS_IS_MOB; + RETVAL = THIS->IsHorse(); + ST(0) = boolSV(RETVAL); + sv_2mortal(ST(0)); + } + XSRETURN(1); +} #ifdef __cplusplus extern "C" @@ -6209,6 +6224,7 @@ XS(boot_Mob) { newXSproto(strcpy(buf, "IsDoor"), XS_Mob_IsDoor, file, "$"); newXSproto(strcpy(buf, "IsTrap"), XS_Mob_IsTrap, file, "$"); newXSproto(strcpy(buf, "IsBeacon"), XS_Mob_IsBeacon, file, "$"); + newXSproto(strcpy(buf, "IsHorse"), XS_Mob_IsHorse, file, "$"); newXSproto(strcpy(buf, "CastToClient"), XS_Mob_CastToClient, file, "$"); newXSproto(strcpy(buf, "CastToNPC"), XS_Mob_CastToNPC, file, "$"); newXSproto(strcpy(buf, "CastToMob"), XS_Mob_CastToMob, file, "$");