fixed the problem where resources didn't track terrain
fixed issue #71 while I was at it