Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2004:
[Freeciv-Dev] (PR#8754) effects patch
Home

[Freeciv-Dev] (PR#8754) effects patch

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#8754) effects patch
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Wed, 14 Jul 2004 06:12:27 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8754 >

> [jdorje@xxxxxxxxxxx - Tue Jul 13 07:39:30 2004]:
> 
> In this code:
> 
> +    resistance = 100 - get_improvement_type(improvement)->sabotage;
> +    if (get_city_bonus(pcity, EFT_SPY_RESISTANT)) {
> +      resistance = 50;
> +    }
> +    if (resistance > 0) {
> +/*      if (myrand(100) < resistance) { */
>         if (myrand (2) == 1) {
> 
> I think there is a big bug.  Setting resistance to 50 will make some 
> buildings more vulnerable to sabotage.  I think the correct code 

Hmmm, yes this is buggy for wonders.

should 
> be more like
> 
>    vulnerability = get_improvement_type(improvement)->sabotage;
>    if (...) {
>      vulnerability /= 2;
>    }
>    if (myrand(100) >= vulnerability) {
>      /* Sabotage fails; diplomat caught. */
>    }
> 
> the current code is buggy IMO because if the diplomat is caught there 
> will never be an incident.  This seems to be the opposite of what should 
> happen.  But the effects patch shouldn't fix this.

Yes, this looks fine.



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