[Freeciv-Dev] Re: transform to/from ocean bug (patch)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Fri, 26 May 2000, Jeff Mallatt wrote:
>
> At 2000/05/15 19:37 , Thue Janus Kristensen wrote:
> >The bug was that when transforming land units would be left at sea with
> >no transport.
> >This patch moves land units in the sea to adjacent land tiles and
> >transports on land to the sea. If there is no suitable terrain near we
> >disband them. Should be applied on top of my unit move cleanup.
>
> Though I'm not really happy about this as a solution to the problem, it
> does circumvent a bug in the server, so let's do it (it can always be
> removed later...). Here's an updated patch which does:
>
> - Again, mining and irrigation can cause land<->ocean changes, so I
> included them.
>
> - Since check_terrain_land_ocean_change() must already determine exactly
> what has changed, I use a return value from it to figure out what to do
> about "stranded" units.
>
> - When the game moves a player's unit, it should notify the player. So, I
> added notifications. Also, in these messages (and in freelog messages) you
> should use unit_name() rather than get_unit_name() -- the latter adds A/D/M
> numbers which are inappropriate in these contexts.
>
> - When a land unit is stranded on ocean, it should be able to move onto a
> boat for rescue. Added this.
>
> - When a sea unit is stranded on land, it should be able to move into a
> city for rescue. Added this.
>
> - When a transporter unit moves from a stranded location, it should take
> its contents. Added this.
>
The transpoter and non-transporter cases coexist happily, halving the
code size.
Also fixes a few cases of using punit where punit2 should have
been used. Makes the if into a case because I really think they make the
code clearer.
And finally, updates to take diplomatic states into account
(enemy_unit->non_allied unit, owned city->allied_city, check if there are
non_allied units in the city before entering)
-Thue
change-to-ocean-moves-units-2.diff
Description: Text Data
|
|