Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2005:
[Freeciv-Dev] (PR#12677) CVS: Spies get built foul, so cannot make embas
Home

[Freeciv-Dev] (PR#12677) CVS: Spies get built foul, so cannot make embas

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#12677) CVS: Spies get built foul, so cannot make embassy
From: "Brendon" <yautja@xxxxxxxxxxxxxxx>
Date: Sun, 27 Mar 2005 23:13:30 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12677 >

The 0 (moves_left) used to be -1 in 2.0.

server/cityturn.c  - L1078
----------------------------------------------
     (void) create_unit(pplayer, pcity->tile, pcity->currently_building,
                       do_make_unit_veteran(pcity, pcity->currently_building),
                       pcity->id, 0);
----------------------------------------------

So when a spy gets built it thinks she has just completed a mission and 
returned to a city, so makes them unit->foul = 1. Which means making an 
embassy with spies is impossible as they get executed every time.

server/unittools.c - L1486
----------------------------------------------
   /* See if this is a spy that has been moved (corrupt and therefore
    * unable to establish an embassy. */
   punit->foul = (moves_left != -1 && unit_flag(punit, F_SPY));
----------------------------------------------

Although I think the above code snippet doesn't even get called when a 
spy escapes, as spies get moved back to a city using teleport_unit
This uses move_unit(), which as far as I can tell uses unit tile lists? 
and doesn't wipe/create_unit() the Spy anyway...q

Should they be made foul in diplomats.c - diplomat_escape now ? Makes 
more sense than keeping it in generic unit functions.

Only tested it by commenting out that line in unittools.c, just updated 
my CVS and now it won't compile (plrhand.c:1462: error: structure has no 
member named `science_cost').

I'll learn to make patches one of these days...

I'll try attach a savegame to the ticket, takes forever to download this 
mailing list on dialup :(.





[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#12677) CVS: Spies get built foul, so cannot make embassy, Brendon <=