You forgot to initialize "VECTOR* to". In the inner else clause you then overwrite random memory with "vec_set(to,mouse_dir3d);" and the following lines.


Always learn from history, to be sure you make the same mistakes again...