Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2003:
[Freeciv-Dev] Re: (PR#6754) Partisans vs. CMA
Home

[Freeciv-Dev] Re: (PR#6754) Partisans vs. CMA

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: chrisk@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#6754) Partisans vs. CMA
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Wed, 5 Nov 2003 04:48:09 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Tue, Nov 04, 2003 at 04:07:55AM -0800, Christian Knoke wrote:
> 
> CVS 04 NOV 2003 HEAD GTK 1.2
> 
> Spiel gespeichert als 'Honecker+1480.sav.gz'
> > 
> 1: Tile at Santiago->2,2 marked as worked but occupied by an enemy unit!
> 1: Tile at Santiago->2,3 marked as unavailable but seems to be available!

To reproduce you have to capture Santiago with the Mech. Inf.

> Probably in connection with partisans.

No.

Stack trace:

#0  0x400df0a1 in kill () from /lib/libc.so.6
#1  0x400dee99 in raise () from /lib/libc.so.6
#2  0x400e0364 in abort () from /lib/libc.so.6
#3  0x400d915d in __assert_fail () from /lib/libc.so.6
#4  0x08092e9d in real_sanity_check_city (pcity=0x854bfd0, file=0x0, line=0) at 
sanitycheck.c:220
#5  0x0806b904 in city_reduce_size (pcity=0x854bfd0, pop_loss=0) at 
cityturn.c:414
#6  0x08068e29 in handle_unit_enter_city (punit=0x0, pcity=0x0) at 
citytools.c:1271
#7  0x080632c5 in handle_unit_move_consequences (punit=0x8571168, src_x=16, 
src_y=7, dest_x=16, 
    dest_y=6) at unittools.c:2737
#8  0x080638fe in move_unit (punit=0x8571168, dest_x=16, dest_y=6, 
transport_units=true, 
    take_from_land=true, move_cost=1) at unittools.c:3042
#9  0x0805b136 in handle_unit_move_request (punit=0x8571168, x=16, y=6, 
igzoc=false, 
    move_diplomat_city=false) at unithand.c:1102
#10 0x0805a0a5 in handle_move_unit (pplayer=0x0, pmove=0x82b71c8) at 
unithand.c:643
#11 0x0804edcf in handle_packet_input (pconn=0x82b7730, packet=0x82b71c8, 
type=137064904)
    at srv_main.c:829
#12 0x0809fdf6 in sniff_packets () at sernet.c:608
#13 0x0804fec5 in main_loop () at srv_main.c:1505
#14 0x080500ca in srv_main () at srv_main.c:1624
#15 0x0804a13e in main (argc=136935968, argv=0xbffff274) at civserver.c:154
#16 0x400ce1c4 in __libc_start_main () from /lib/libc.so.6

Reason:

The center of the city is marked as worked but an enemy unit (Mech
Inf) stands there. The city ownership gets transfered later (30 lines
later in handle_unit_enter_city).

Patch:

Move the reduction of the city after the ownership has been
transfered.

There may be other side effects but the current code is obviously
wrong.

        Raimar

P.S.: CMA is the citizen management _agent_. This is a purely client
side thing. CM (without the A) was recently added to the server and
this is what you mean here.

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  A supercomputer is a computer running an endless loop in just a second

Index: server/citytools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/citytools.c,v
retrieving revision 1.239
diff -u -u -r1.239 citytools.c
--- server/citytools.c  2003/11/04 10:38:00     1.239
+++ server/citytools.c  2003/11/05 12:44:25
@@ -1268,7 +1268,6 @@
     return;
   }
 
-  city_reduce_size(pcity, 1);
   coins = cplayer->economic.gold;
   coins = myrand((coins / 20) + 1) + (coins * (pcity->size)) / 200;
   pplayer->economic.gold += coins;
@@ -1305,6 +1304,7 @@
   make_partisans(pcity);
 
   transfer_city(pplayer, pcity , 0, TRUE, TRUE, TRUE);
+  city_reduce_size(pcity, 1);
   send_player_info(pplayer, pplayer); /* Update techs */
 
   if (do_civil_war) {

[Prev in Thread] Current Thread [Next in Thread]