K 10
svn:author
V 3
jjm
K 8
svn:date
V 27
2000-04-25T12:00:53.000000Z
K 7
svn:log
V 1984
Fixes bugs in the recent code which allows ocean to be changed into land.

Continent information was not being updated:

- Adds check_terrain_ocean_land_change() to unitfunc.c to handle side-effects.

- Calls check_terrain_ocean_land_change() from all three of the Mining,
Irrigation and Transforming sections of update_unit_activity().

- Adds a new clause to the "if" statement in handle_tile_info() in
packhand.c so that climap_update_continents() is called whenever ocean is
changed into land.

The terrain ruleset allows for changing land into ocean -- but the code
didn't handle this case correctly.  The gamelog map becomes out of date
whenever ocean is changed into land (or vice-versa):

- Makes sure the new check_terrain_ocean_land_change() can handle changing
land into ocean.

- Changes can_unit_do_activity_targeted() to not allow changing the land on
which a city sits into ocean.

- Changes map_mine_tile(), map_irrigate_tile() and map_transform_tile() to
clear all infrastructure when changing from land to ocean.

- Adds a new case in handle_tile_info() that recomputes the client's
continents whenever land is changed into ocean.

- Makes a small change to climap_update_continents() which allows it to
work in the case where the tile "known" flags are set, but the tile
"continent" values are not (it should not affect normal operation).  This
allows a simple implementation of the previous change.

- Adds gamelog() calls to the new check_terrain_ocean_land_change() function.

- Does a klugey thing in gamelog() itself (we should fix the gamelog format
and open/close semantics someday...).

- Finally, to make use of all this, changes default/terrain.ruleset to
allow Transforming Swamp into Ocean (was Swamp->Plains; may still do
Swamp->Forest->Plains (and it's faster!)), and Mining Forest into Swamp.

Finally:

- Fixes an unrelated bug in the ACTIVITY_MINE case of
can_unit_do_activity_targeted().

Bug reported by Cameron Morland <cjmorland@uwaterloo.ca>.

END
