Dumb question about handles

Posted By: JetpackMonkey

Dumb question about handles - 05/28/08 17:49

Hey! I'm stumped, can someone answer why:

var funbananas;

you.whatever = handle(smellyThing);
funbananas = handle(you);
vec_diff(temp.x,camera.x,funbananas.x);

Returns an error that "x is not a member of function" (whatever that is supposed to mean). BUT if I replace funbananas.x with you.x, it works. It seems like Lite-C doesn't like my using the funbananas handle as .x directly

Any ideas what's going on or what I am doing wrong?

Dyuhhhh thanks :P
Posted By: HeelX

Re: Dumb question about handles - 05/28/08 17:56

Handles are just ID's of the objects -and- vars are no ENTITY pointers (see the ENTITY struct definition in atypes.h). you is an entity struct.

If you want to retrieve the you pointer again from the handle, you can do

ENTITY* superfunkygirl;
superfunkygirl = (ENTITY*)ptr_for_handle(funbananas);

vec_diff(...., superfunkygirl->x);
© 2024 lite-C Forums