Bounds checking added to map data

Moving the cursor outside of the window in things or prefabs mode no
longer crashes the program.