Replace at the beginning of int addmenutarget: if (s!=-1 && buffer[s][11]==0xFF && buffer[s][12]==0xFF && buffer[s][13]==0xFF && buffer[s][14]==0xFF) return -1; With: if ((s!=-1) || (buffer[s][11]==0xFF && buffer[s][12]==0xFF && buffer[s][13]==0xFF && buffer[s][14]==0xFF)) return -1; Someone must have changed my code there and messed it up by that, so it places an item at (0;0;0) whenever you hit escape to cancel item placement. You might want to check if this bugged line appears in some other targetting function as well.