Hi,
you need to specifically cast the skill. I read JCL confirming it is perfectly safe and I have done it hundreds o times with no problem. Anyway it is a good idea to specify every cast so it shows you know what you are doing.
ent.bpd_postoutput_func = (void*)player_camera;
....
bipedFunctionPtr = (void*)ent.bpd_postoutput_func;
Alternativelly you can also build a struct with function pointers and save its handle on a skill.
typedef struct
{
void action1 ();
void action2 ();
...
} MYACTION;
void myCustomAction ()
{
...
}
...
MYACTIONS *myActions = sys_malloc ( sizeof(MYACTIONS) );
ent->skill1 = handle ( myActions );
myActions->action1 = myCustomAction;
myActions->action2 = ...
...
MYACTIONS *myActions = ptr_for_handle ( ent->skill1 );
myActions->action1 ();
edited____________________
Sorry but I failed. 'handle' does not work with custom structs.
Salud!
Last edited by txesmi; 08/30/14 06:12. Reason: error, error, error...