View Single Post
  #10  
Old 02-03-2013, 10:19 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

perl_mob.cpp, line 7592
Code:
XS(XS_Mob_SetTargetable); /* prototype to pass -Wmissing-prototypes */
XS(XS_Mob_SetTargetable)
{
	dXSARGS;
	if (items != 2)
		Perl_croak(aTHX_ "Usage: Mob::SetTargetable(THIS, on)");
	{
		Mob *		THIS;
		bool on = (bool)SvTRUE(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 == NULL)
			Perl_croak(aTHX_ "THIS is NULL, avoiding crash.");

		THIS->SetTargetable(on);
	}
	XSRETURN_EMPTY;
}
Reply With Quote