Here is some of the code I am using ... selected is a pointer to the selected entity, temp and temp2 are globals ... I know they should be more descriptive but this is just test code, once I get it to work I make the code all pretty ... :-). The object selected does move, but very wildly ... this is not what I want.
function moveObject()
{
temp.x = mouse_pos.x;
temp.y = mouse_pos.y;
temp.z = 100;
temp2.x = selected.x; temp2.y = selected.y; temp2.z = selected.z;
while(temp.x != selected.x && temp.y != selected.y && temp.z != selected.z)
{
c_move (selected, temp2, temp, GLIDE);
wait(1);
}
}