mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 09:31:30 +00:00
Merge pull request #514 from hateborne/master
Exported GetSpellIDFromSlot into Perl
This commit is contained in:
commit
620ac2a685
@ -2362,6 +2362,37 @@ XS(XS_Mob_GetSpellHPBonuses)
|
||||
XSRETURN(1);
|
||||
}
|
||||
|
||||
XS(XS_Mob_GetSpellIDFromSlot); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_Mob_GetSpellIDFromSlot)
|
||||
{
|
||||
dXSARGS;
|
||||
if (items != 2)
|
||||
Perl_croak(aTHX_ "Usage: Mob::GetSpellIDFromSlot(THIS, slot)");
|
||||
{
|
||||
Mob * THIS;
|
||||
int RETVAL;
|
||||
dXSTARG;
|
||||
uint8 slot = (uint16)SvUV(ST(1));
|
||||
|
||||
if (sv_derived_from(ST(0), "Mob")) {
|
||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||
THIS = INT2PTR(Mob *, tmp);
|
||||
}
|
||||
else
|
||||
Perl_croak(aTHX_ "THIS is not of type Mob");
|
||||
if (THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
if (slot > THIS->GetMaxBuffSlots())
|
||||
RETVAL = -1;
|
||||
else
|
||||
RETVAL = THIS->GetSpellIDFromSlot(slot);
|
||||
|
||||
XSprePUSH; PUSHi((IV)RETVAL);
|
||||
}
|
||||
XSRETURN(1);
|
||||
}
|
||||
|
||||
XS(XS_Mob_GetWalkspeed); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_Mob_GetWalkspeed)
|
||||
{
|
||||
@ -9105,6 +9136,7 @@ XS(boot_Mob)
|
||||
newXSproto(strcpy(buf, "GetMaxHP"), XS_Mob_GetMaxHP, file, "$");
|
||||
newXSproto(strcpy(buf, "GetItemHPBonuses"), XS_Mob_GetItemHPBonuses, file, "$");
|
||||
newXSproto(strcpy(buf, "GetSpellHPBonuses"), XS_Mob_GetSpellHPBonuses, file, "$");
|
||||
newXSproto(strcpy(buf, "GetSpellIDFromSlot"), XS_Mob_GetSpellIDFromSlot, file, "$$");
|
||||
newXSproto(strcpy(buf, "GetWalkspeed"), XS_Mob_GetWalkspeed, file, "$");
|
||||
newXSproto(strcpy(buf, "GetRunspeed"), XS_Mob_GetRunspeed, file, "$");
|
||||
newXSproto(strcpy(buf, "GetCasterLevel"), XS_Mob_GetCasterLevel, file, "$$");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user