I did what you said and now the whole program crashes ... ugggg this is the complete code ... "selected" is the entity that has been selected with a left mouse click ... a right click then calls the following ...
function moveObject()
{
while(1){
mouse_mode = 4;
mouse_range = 10000;
//mouse_map = IM_MOUSE;
mouse_pos.x = mouse_cursor.x;
mouse_pos.y = mouse_cursor.y;
Temp1.x = mouse_pos.x;
Temp1.y = mouse_pos.y;
Temp1.z = 50;
vec_for_screen(Temp1,camera);
Temp2.x = mouse_pos.x;
Temp2.y = mouse_pos.y;
Temp2.z = 5000;
vec_for_screen(Temp2,camera);
c_trace(Temp1,Temp2,IGNORE_PASSABLE | IGNORE_YOU);
target.z += 30;
vec_set(selected.x,target.x);
if(vec_dist(my.x,my.Target_X) > 14)
{
selected.skill1 = 5*time_step;
}
vec_diff(Temp,selected.x,selected.x);
Temp.y = 0;
vec_to_angle(selected.pan,Temp);
c_move(selected,selected.skill1,nullvector,GLIDE + IGNORE_ME);
wait(1);
}
}
I changed the Temp variables to normal vectors, I couldn't understand why they were arrays ... Temp1[] and Temp2[] maybe I shoudn't have done that but it didn't even compile that way.