Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2003:
[Freeciv-Dev] Re: (PR#4044) Revised multiple veteran patch
Home

[Freeciv-Dev] Re: (PR#4044) Revised multiple veteran patch

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: james.blewitt@xxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#4044) Revised multiple veteran patch
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Tue, 2 Sep 2003 13:29:25 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Tue, 2 Sep 2003, ue80@xxxxxxxxxxxxxxxxxxxxx wrote:
> > > > 3) NONE spy can't escape.
> > > >
> > > >  struct city *spyhome = find_city_by_id (pdiplomat->homecity);
> > > >  if (!spyhome) {
> > > >    send_unit_info (pplayer, pdiplomat);
> > > >    freelog(LOG_ERROR, "Bug in diplomat_escape: Unhomed Spy.");
> > > >    return;
> > > >  }
> > > >
> > > > in this case "spyhome" should be capital or (if Palace is destroyed)
> > > > first city on list or nerrest friendly city.
> > >
> > > Right. Also, if we don't have any cities (also theoretically
> > possible), it
> > > should simply die, without any error message (it is not an error
> > > situation).
> > >
> > > - Per
> > >
> > How about Spy in a hut? How about city was destroyed while spy
> > was out. (Same turn as city was destroyed, spy still exists.)
>
> Easier, think of screnarios with units without homecities.

Keep in mind that the above is for when a spy is attempting to escape
after successfully doing diplomatics. The code should:
1) Attempt to use punit->homecity
2) Attempt to find a nearest friendly city
3) Disband the unit

If the unit cannot teleport to safety, it should die.

> But that case doesn't happen in the current game, so we don't have to
> care about that in the code.

Oh yes we do. The code should care about and handle all allowed
combinations of existing rules.

  - Per




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