Why not comparing the floored old and new x and z values? y should be irrelevant.