<URL: http://bugs.freeciv.org/Ticket/Display.html?id=9568 >
On 1/13/07, Marko Lindqvist <[EMAIL PROTECTED]> wrote: > > > Untested patch for carrying fuel and some other info over bribing. > Moves_left should be already ok. Bomber probably attacked in the > beginning of the next turn and not in the same turn. This version also sends info about less-than-full fuel to new owner. > I plan to commit this to trunk only. Forget that. At least to S2_1 and trunk. I have to check S2_0. - ML
diff -Nurd -X.diff_ignore freeciv/server/diplomats.c freeciv/server/diplomats.c --- freeciv/server/diplomats.c 2006-09-07 23:51:20.000000000 +0300 +++ freeciv/server/diplomats.c 2007-01-14 06:56:16.000000000 +0200 @@ -404,12 +404,13 @@ int diplomat_id; struct tile *victim_tile; bool vet = FALSE; + struct unit *gained_unit = NULL; /* Fetch target unit's player. Sanity checks. */ if (!pvictim) return; uplayer = unit_owner(pvictim); - /* We might make it allowable in peace with a liss of reputaion */ + /* We might make it allowable in peace with a loss of reputation */ if (!uplayer || pplayers_allied(pplayer, uplayer)) return; @@ -450,10 +451,18 @@ freelog (LOG_DEBUG, "bribe-unit: succeeded"); /* Convert the unit to your cause. Fog is lifted in the create algorithm. */ - (void) create_unit_full(pplayer, pvictim->tile, - pvictim->type, pvictim->veteran, - pdiplomat->homecity, pvictim->moves_left, - pvictim->hp, NULL); + gained_unit = create_unit_full(pplayer, pvictim->tile, + pvictim->type, pvictim->veteran, + pdiplomat->homecity, pvictim->moves_left, + pvictim->hp, NULL); + + /* Copy some more unit fields */ + gained_unit->fuel = pvictim->fuel; + gained_unit->foul = pvictim->foul; + gained_unit->paradropped = pvictim->paradropped; + + /* Inform owner about less than full fuel */ + send_unit_info(pplayer, gained_unit); /* Check if the unit gained veteran level */ vet = maybe_make_veteran(pdiplomat); @@ -514,7 +523,7 @@ - The thief may be captured and executed, or escape to its home town. - FIXME: It should give a loss of reputaion to steal from a player you are + FIXME: It should give a loss of reputation to steal from a player you are not at war with ****************************************************************************/ void diplomat_get_tech(struct player *pplayer, struct unit *pdiplomat, diff -Nurd -X.diff_ignore freeciv/server/unittools.c freeciv/server/unittools.c --- freeciv/server/unittools.c 2006-08-18 10:51:27.000000000 +0300 +++ freeciv/server/unittools.c 2007-01-14 06:54:53.000000000 +0200 @@ -1273,6 +1273,7 @@ /************************************************************************** Creates a unit, and set it's initial values, and put it into the right lists. + If moves_left is less than zero, unit will get max moves. **************************************************************************/ struct unit *create_unit_full(struct player *pplayer, struct tile *ptile, struct unit_type *type, int veteran_level,
_______________________________________________ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev