Complete.Org: Mailing Lists: Archives: freeciv-dev: December 1998:
[Freeciv-Dev] diplomats/spies defending vs incite
Home

[Freeciv-Dev] diplomats/spies defending vs incite

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] diplomats/spies defending vs incite
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Fri, 18 Dec 1998 21:20:14 +1100

Hi all,

While fixing some more cases where "spy" vs "diplomat" was
not distinguished properly in messages (thanks Reinier),
I came across some strange code: 
In server/unitfunc.c, in diplomat_incite(), we have:

>>>>
  if (diplomat_on_tile(pcity->x, pcity->y)) {
    notify_player_ex(pplayer, pcity->x, pcity->y, E_MY_DIPLOMAT,
                     "Game: Your spy has been eliminated by a defending spy in %
s.", pcity->name);
    notify_player_ex(cplayer, pcity->x, pcity->y, E_DIPLOMATED,
                     "Game: A%s %s spy has been eliminated in %s.", 
                     n_if_vowel(get_race_name(cplayer->race)[0]), 
                     get_race_name(cplayer->race), pcity->name);
    wipe_unit(0, pdiplomat);
    return;
  }

  /* Check if the Diplomat/Spy succeeds against defending Diplomats or Spies */

  if (!diplomat_infiltrate_city(pplayer, cplayer, pdiplomat, pcity))
    return;  /* failed against defending diplomats/spies */
<<<<

The first check says if there are _any_ spies/diplomats in
the city, then the incite fails.  Then the second check goes
through the diplchance calculations to resolve the attacker 
spy/diplomat vs any defending spies/diplomats.  

So having both seems wrong, and the above code means 
spies and diplomats are perfect defenders vs incite 
attempts.

In cvs, I've removed (#if 0) the first check, so that now 
spies/diplomats have the usual chances to defend against 
incite as vs other diplomat/spy attacks.  If anyone disagrees
with this change, speak up.

-- David


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