The board initialization procedure no longer ensures that unused bits of
the goal bitmap are zeroed. When these are ORed with the game bitmaps,
it can result in bogus values for the outer tiles, which will either
render incorrectly or trip the assertion if the tile value is 7.
Normally only the objective area tiles get redrawn when the feature
is toggled on or off, which hides the problem most of the time, as
something else needs to trigger redraw of the outer tiles. One way
to make this happen is to use the keyboard to start a new game while
holding down the right mouse button.
The best solution seems to be to just mask the goal bitmaps where
they are used. As the same fix is needed in both the curses and
motif UIs, implement this new logic into a common function and add
a new test case to check for this bug.