Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2006:
[Freeciv-Dev] (PR#15091) Assert fail on connect order

[Freeciv-Dev] (PR#15091) Assert fail on connect order

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#15091) Assert fail on connect order
From: "Dave Vandervies" <dj3vande@xxxxxxxxxx>
Date: Sat, 7 Jan 2006 17:40:10 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: >

When trying to connect with irrigation starting on a hill tile with a
mine, the client will dump core with an assert fail.

I think I've tracked this down to an inconsistency between the connect
turn-counting code (which doesn't want to destroy mines) and the can-
we-connect check (which doesn't check for this), and was able to make
the problem go away by adding a check for whether the unit is on a
square with a mine in can_unit_do_connect() (in control.c in the client

I'm seeing this in the XAW client, but it looks to me like the problem
is in code that all clients would use.

diff -c says:
*** freeciv-2.0.7/client/control.c      Tue Oct 18 15:06:15 2005
--- freeciv-2.0.7-local-changes/client/control.c        Sat Jan  7 18:41:34 2006
*** 665,672 ****
--- 665,674 ----
      /* Special case for irrigation: only irrigate to make S_IRRIGATION,
       * never to transform tiles. */
+     /* Additional special case:  Connect will never destroy mines. */
      return (terrain_control.may_irrigate
            && unit_flag(punit, F_SETTLERS)
+           && !tile_has_special(punit->tile, S_MINE)
            && (tile_has_special(punit->tile, S_IRRIGATION)
                || (terrain == ttype->irrigation_result
                    && is_water_adjacent_to_tile(punit->tile)

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#15091) Assert fail on connect order, Dave Vandervies <=