I recently had a problem like this, the cursor moves away from the
mouse position badly if you rotate the camera?
Try this instead. Could be badly wrong though.
function mouse_controll()
{
temp.x = mouse_cursor.x;
temp.y = mouse_cursor.y;
temp.z = camera.z;
rel_for_screen(temp,camera);
c_trace(camera,vector(temp.x,temp.y,-4000),IGNORE_ME | IGNORE_PASSABLE);
editor_raster_scale(temp.x,32);
}
I'll have a closer look later...
Any chance of getting the complete code (with models)?