mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
Update perl_mob.cpp
This commit is contained in:
parent
dfe4bb5b78
commit
a402f01514
@ -1135,28 +1135,28 @@ XS(XS_Mob_ChangeSize) {
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
+XS(XS_Mob_RandomizeFeatures); /* prototype to pass -Wmissing-prototypes */
|
||||
+XS(XS_Mob_RandomizeFeatures) {
|
||||
+ dXSARGS;
|
||||
+ if (items < 2 || items > 3)
|
||||
+ Perl_croak(aTHX_ "Usage: Mob::RandomizeFeatures(THIS, bool send_illusion, set_variables)");
|
||||
+ {
|
||||
+ Mob *THIS;
|
||||
+ bool send_illusion = (bool) SvNV(ST(1));
|
||||
+ bool set_variables = (bool) SvNV(ST(2));
|
||||
+
|
||||
+ 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.");
|
||||
+
|
||||
+ THIS->RandomizeFeatures(send_illusion, set_variables);
|
||||
+ }
|
||||
+ XSRETURN_EMPTY;
|
||||
+}
|
||||
XS(XS_Mob_RandomizeFeatures); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_Mob_RandomizeFeatures) {
|
||||
dXSARGS;
|
||||
if (items < 2 || items > 3)
|
||||
Perl_croak(aTHX_ "Usage: Mob::RandomizeFeatures(THIS, bool send_illusion, set_variables)");
|
||||
{
|
||||
Mob *THIS;
|
||||
bool send_illusion = (bool) SvNV(ST(1));
|
||||
bool set_variables = (bool) SvNV(ST(2));
|
||||
|
||||
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.");
|
||||
|
||||
THIS->RandomizeFeatures(send_illusion, set_variables);
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
XS(XS_Mob_GMMove); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_Mob_GMMove) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user