Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: new natural names patch (PR#1127)
Home

[Freeciv-Dev] Re: new natural names patch (PR#1127)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: new natural names patch (PR#1127)
From: "mateusz stefek" <matusik_s@xxxxx>
Date: Sun, 23 Dec 2001 16:06:54 +0100

>+      /*
>+       * "terrain" is -1 if we don't have the terrain, 1 if  we do.
>+       * "goodness" therefore becomes positive if we like the terrain,
>+       * negative if we don't.  The integer values are just
>+       * approximations, so...
>+       *
>+       * The reason we multiply as well as divide the value is so
>+       * that cities that don't care what terrain they are on (which
>+       * is the default) will be left in the middle of the pack.  If
>+       * we _only_ multiplied (or divided), then cities that had more
>+       * terrain labels would have their priorities hurt (or helped).
>+       */
>+      goodness = (map_get_special(x, y) & S_RIVER) ?
>+               choice->river : -choice->river;
>+      if (goodness > 0) {
>+        value = (float)value / 1.4;
>+      } else if (goodness < 0) {
>+      value = (float)value * 1.4;
>+      }
>+
1)
I think the below code is more readable:

      if (choice->river != 0){
        if ((map_get_special(x, y) & S_RIVER) ^ (choice->river == -1))
          value /= 1.4; else value *= 1.4;
      }

2)
Comment    /* coastal */ in city_name_suggestion is now wrong (should have been 
removed)

----
mateusz






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