mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-16 05:11:29 +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;
|
XSRETURN_EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
+XS(XS_Mob_RandomizeFeatures); /* prototype to pass -Wmissing-prototypes */
|
XS(XS_Mob_RandomizeFeatures); /* prototype to pass -Wmissing-prototypes */
|
||||||
+XS(XS_Mob_RandomizeFeatures) {
|
XS(XS_Mob_RandomizeFeatures) {
|
||||||
+ dXSARGS;
|
dXSARGS;
|
||||||
+ if (items < 2 || items > 3)
|
if (items < 2 || items > 3)
|
||||||
+ Perl_croak(aTHX_ "Usage: Mob::RandomizeFeatures(THIS, bool send_illusion, set_variables)");
|
Perl_croak(aTHX_ "Usage: Mob::RandomizeFeatures(THIS, bool send_illusion, set_variables)");
|
||||||
+ {
|
{
|
||||||
+ Mob *THIS;
|
Mob *THIS;
|
||||||
+ bool send_illusion = (bool) SvNV(ST(1));
|
bool send_illusion = (bool) SvNV(ST(1));
|
||||||
+ bool set_variables = (bool) SvNV(ST(2));
|
bool set_variables = (bool) SvNV(ST(2));
|
||||||
+
|
|
||||||
+ if (sv_derived_from(ST(0), "Mob")) {
|
if (sv_derived_from(ST(0), "Mob")) {
|
||||||
+ IV tmp = SvIV((SV *) SvRV(ST(0)));
|
IV tmp = SvIV((SV *) SvRV(ST(0)));
|
||||||
+ THIS = INT2PTR(Mob *, tmp);
|
THIS = INT2PTR(Mob *, tmp);
|
||||||
+ } else
|
} else
|
||||||
+ Perl_croak(aTHX_ "THIS is not of type Mob");
|
Perl_croak(aTHX_ "THIS is not of type Mob");
|
||||||
+ if (THIS == nullptr)
|
if (THIS == nullptr)
|
||||||
+ Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||||
+
|
|
||||||
+ THIS->RandomizeFeatures(send_illusion, set_variables);
|
THIS->RandomizeFeatures(send_illusion, set_variables);
|
||||||
+ }
|
}
|
||||||
+ XSRETURN_EMPTY;
|
XSRETURN_EMPTY;
|
||||||
+}
|
}
|
||||||
|
|
||||||
XS(XS_Mob_GMMove); /* prototype to pass -Wmissing-prototypes */
|
XS(XS_Mob_GMMove); /* prototype to pass -Wmissing-prototypes */
|
||||||
XS(XS_Mob_GMMove) {
|
XS(XS_Mob_GMMove) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user