CleverRaven/Cataclysm-DDA — pull request #8241 by BevapDin (2014-07-15 18:09:06+00:00)
Title: Shift traplocs on map shift

When the map shifts, `map::forget_traps` is called to remove traps from the traps-map that are now outside of the map.

But traps that remain in the map are not changed. Their position is then wrong.

This can be easily tested:
- put a funnel somewhere, add a suitable container to the field.
- put another suitable container exactly 12 squares to the south (direction does not actually matter, but it must be on the same place on another submap, could also be 24 squares to the west).
- don't move around, but let it rain, wait till it stops raining.
The second container will be filled, the other (on the funnel) won't.
Also easily checked in the debugger: `map::traplocs` does not change when shifting.

I added code to `map::copy_grid` that moves the trap points in `map::traplocs`.

----

Another bug:

When you open the View items around menu and the initially select item is directly to the north west, the cursor for that item is not shown. When you move the selection to next item and back it is shown. This work flawless when the item first item is anywhere else.

The reason is that `iLastActive[XY]` is initialized to (-1,-1), which are (in that context) the coordinates of the square northwest of the player. The function auto-selects the nearest item and places the cursor on it, but only if the cursor is not already there. If the nearest item it to the northwest (-1,-1) the function does not place the cursor as it seems to already be there (`iLastActive[XY]`).

Changing the initial point to (INT_MIN, INT_MIN) fixes this.