View Single Post
  #3  
Old 10-26-2008, 01:46 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

the only place that seems to do some kind of calc to determine if true or false should be sent to FaceTarget() method is in perl_mob.cpp
Code:
XS(XS_Mob_FaceTarget); /* prototype to pass -Wmissing-prototypes */
XS(XS_Mob_FaceTarget)
{
	dXSARGS;
	if (items < 1 || items > 3)
		Perl_croak(aTHX_ "Usage: Mob::FaceTarget(THIS, MobToFace= 0, bool update)");
	{
		Mob *		THIS;
		Mob*		MobToFace;
		bool		update;

		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.");

		if (items < 2)
			MobToFace = 0;
		else {
			if (sv_derived_from(ST(1), "Mob")) {
				IV tmp = SvIV((SV*)SvRV(ST(1)));
				MobToFace = INT2PTR(Mob *,tmp);
			}
			else
				Perl_croak(aTHX_ "MobToFace is not of type Mob");
			if(MobToFace == NULL)
				Perl_croak(aTHX_ "MobToFace is NULL, avoiding crash.");
		}

		if (items < 3)
			update = false;
		else {
			update = (bool)SvTRUE(ST(2));
		}

		THIS->FaceTarget(MobToFace, update);
	}
	XSRETURN_EMPTY;
}
Im not familiar with this part of the code, can somebody comment on this? I didn't see quest::FaceTarget() used in any perl files. Is that what this is for?
Reply With Quote