Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2003:
[Freeciv-Dev] (PR#5431) Unecessary Global Variable in mapgen.c
Home

[Freeciv-Dev] (PR#5431) Unecessary Global Variable in mapgen.c

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: cameron@xxxxxxxxxx
Subject: [Freeciv-Dev] (PR#5431) Unecessary Global Variable in mapgen.c
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 27 Aug 2003 13:26:56 -0700
Reply-to: rt@xxxxxxxxxxxxxx

[cameron - Tue Aug 26 19:41:46 2003]:

> totalweight is a global variable, but there is no reason for it to be
> so. And the way it is treated in mapgenerator2 is both bizarre and
> useless. This patch makes the code easier to read, and is separate from
> a gen2 bug I'm trying to track down.

But you still make it static?  Why?


This code is just amazing:

-  totalweight= 0;
-  for (i = game.nplayers; i > 0; i--)
-    totalweight+= 70;
-  for (i = game.nplayers; i > 0; i--)
-    totalweight+= 20;
-  for (i = game.nplayers; i > 0; i--)
-    totalweight+= 10;
+  totalweight = 100 * game.nplayers;

Is there something I'm missing?  Seems like it's worth a patch all on
its own.


And, this change:

-  } else if(checkmass>map.xsize+map.ysize+totalweight) {
+  } else if(checkmass>map.xsize+map.ysize) {

Why is it there?

jason



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