mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 23:20:25 +00:00
Add IsTaunting() to Perl/Lua.
This commit is contained in:
@@ -991,6 +991,30 @@ XS(XS_NPC_SetTaunting) {
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
XS(XS_NPC_IsTaunting); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_NPC_IsTaunting) {
|
||||
dXSARGS;
|
||||
if (items != 1)
|
||||
Perl_croak(aTHX_ "Usage: NPC::IsTaunting(THIS)");
|
||||
{
|
||||
NPC *THIS;
|
||||
bool RETVAL;
|
||||
|
||||
if (sv_derived_from(ST(0), "NPC")) {
|
||||
IV tmp = SvIV((SV *) SvRV(ST(0)));
|
||||
THIS = INT2PTR(NPC *, tmp);
|
||||
} else
|
||||
Perl_croak(aTHX_ "THIS is not of type NPC");
|
||||
if (THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
RETVAL = THIS->IsTaunting();
|
||||
ST(0) = boolSV(RETVAL);
|
||||
sv_2mortal(ST(0));
|
||||
}
|
||||
XSRETURN(1);
|
||||
}
|
||||
|
||||
XS(XS_NPC_PickPocket); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_NPC_PickPocket) {
|
||||
dXSARGS;
|
||||
@@ -2528,6 +2552,7 @@ XS(boot_NPC) {
|
||||
newXSproto(strcpy(buf, "SetPetSpellID"), XS_NPC_SetPetSpellID, file, "$$");
|
||||
newXSproto(strcpy(buf, "GetMaxDamage"), XS_NPC_GetMaxDamage, file, "$$");
|
||||
newXSproto(strcpy(buf, "SetTaunting"), XS_NPC_SetTaunting, file, "$$");
|
||||
newXSproto(strcpy(buf, "IsTaunting"), XS_NPC_IsTaunting, file, "$");
|
||||
newXSproto(strcpy(buf, "PickPocket"), XS_NPC_PickPocket, file, "$$");
|
||||
newXSproto(strcpy(buf, "StartSwarmTimer"), XS_NPC_StartSwarmTimer, file, "$$");
|
||||
newXSproto(strcpy(buf, "DoClassAttacks"), XS_NPC_DoClassAttacks, file, "$$");
|
||||
|
||||
Reference in New Issue
Block a user