mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
LUA/PERL - IsStanding() and IsCrouching() - Returns as bools
This commit is contained in:
@@ -2596,6 +2596,32 @@ XS(XS_Client_UntrainDiscAll) {
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
XS(XS_Client_IsStanding); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_Client_IsStanding)
|
||||
{
|
||||
dXSARGS;
|
||||
if (items != 1)
|
||||
Perl_croak(aTHX_ "Usage: Client::IsStanding(THIS)");
|
||||
{
|
||||
Client * THIS;
|
||||
bool RETVAL;
|
||||
|
||||
if (sv_derived_from(ST(0), "Client")) {
|
||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||
THIS = INT2PTR(Client *,tmp);
|
||||
}
|
||||
else
|
||||
Perl_croak(aTHX_ "THIS is not of type Client");
|
||||
if(THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
RETVAL = THIS->IsStanding();
|
||||
ST(0) = boolSV(RETVAL);
|
||||
sv_2mortal(ST(0));
|
||||
}
|
||||
XSRETURN(1);
|
||||
}
|
||||
|
||||
XS(XS_Client_IsSitting); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_Client_IsSitting) {
|
||||
dXSARGS;
|
||||
@@ -2620,6 +2646,32 @@ XS(XS_Client_IsSitting) {
|
||||
XSRETURN(1);
|
||||
}
|
||||
|
||||
XS(XS_Client_IsCrouching); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_Client_IsCrouching)
|
||||
{
|
||||
dXSARGS;
|
||||
if (items != 1)
|
||||
Perl_croak(aTHX_ "Usage: Client::IsCrouching(THIS)");
|
||||
{
|
||||
Client * THIS;
|
||||
bool RETVAL;
|
||||
|
||||
if (sv_derived_from(ST(0), "Client")) {
|
||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||
THIS = INT2PTR(Client *,tmp);
|
||||
}
|
||||
else
|
||||
Perl_croak(aTHX_ "THIS is not of type Client");
|
||||
if(THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
RETVAL = THIS->IsCrouching();
|
||||
ST(0) = boolSV(RETVAL);
|
||||
sv_2mortal(ST(0));
|
||||
}
|
||||
XSRETURN(1);
|
||||
}
|
||||
|
||||
XS(XS_Client_IsBecomeNPC); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_Client_IsBecomeNPC) {
|
||||
dXSARGS;
|
||||
@@ -6338,7 +6390,9 @@ XS(boot_Client) {
|
||||
newXSproto(strcpy(buf, "IsLD"), XS_Client_IsLD, file, "$");
|
||||
newXSproto(strcpy(buf, "IsMedding"), XS_Client_IsMedding, file, "$");
|
||||
newXSproto(strcpy(buf, "IsRaidGrouped"), XS_Client_IsRaidGrouped, file, "$");
|
||||
newXSproto(strcpy(buf, "IsStanding"), XS_Client_IsStanding, file, "$");
|
||||
newXSproto(strcpy(buf, "IsSitting"), XS_Client_IsSitting, file, "$");
|
||||
newXSproto(strcpy(buf, "IsCrouching"), XS_Client_IsCrouching, file, "$");
|
||||
newXSproto(strcpy(buf, "IsTaskActive"), XS_Client_IsTaskActive, file, "$$");
|
||||
newXSproto(strcpy(buf, "IsTaskActivityActive"), XS_Client_IsTaskActivityActive, file, "$$$");
|
||||
newXSproto(strcpy(buf, "IsTaskCompleted"), XS_Client_IsTaskCompleted, file, "$$");
|
||||
|
||||
Reference in New Issue
Block a user