Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2001:
[Freeciv-Dev] PATCH: corruption penalty for small cities (PR#720)
Home

[Freeciv-Dev] PATCH: corruption penalty for small cities (PR#720)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] PATCH: corruption penalty for small cities (PR#720)
From: Lino Mastrodomenico <l.mastrodomenico@xxxxxxxxxxxxxx>
Date: Wed, 7 Mar 2001 09:47:31 -0800 (PST)

Hi all.

This patch (against current CVS) introduces a new server option: 
"corruptsize".
There is a minimum corruption in all cities _smaller_ than this value: the 
minimum is 100% for sizes up to corruptsize/3, and decreases gradually to 0% 
for size=corruptsize.

E.g.: with corruptsize=6, cities of size 1 and 2 produce no trade, and there 
is a minimum corruption of 75%, 50% & 25% for sizes 3, 4 & 5 respectively.

The patch's core is:

diff -ur -Xorig1/diff_ignore orig1/server/citytools.c patch1/server/citytools.c
--- orig1/server/citytools.c    Sun Mar  4 23:44:07 2001
+++ patch1/server/citytools.c   Wed Mar  7 18:14:52 2001
@@ -559,6 +559,9 @@
     val /= 2;
   val *= g->corruption_level;
   val /= 100;
+
+  /* corruption penalty if city is smaller than corruptionsize */
+  val = MAX(val, trade * (game.corruptionsize - pcity->size) * 3 / 2 / 
game.corruptionsize);
   if (val > trade)
     val = trade;
   return(val); /* how did y'all let me forget this one? -- Syela */


There is no effect at all when corruption_level is 0 (under democracy) and 
the default value is 1, so the patch is completely backward compatible.

I hope this helps against smallpox.

ciao

-- 
Lino Mastrodomenico
E-mail: l.mastrodomenico@xxxxxxxxxxxxxx

Attachment: corruption_for_small_cities.diff
Description: Text document


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] PATCH: corruption penalty for small cities (PR#720), Lino Mastrodomenico <=