[Freeciv-Dev] Re: new natural names patch (PR#1127)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
>+ /*
>+ * "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
- [Freeciv-Dev] Re: new natural names patch (PR#1127), (continued)
- [Freeciv-Dev] Re: new natural names patch (PR#1127), Chris Richards, 2001/12/22
- [Freeciv-Dev] Re: new natural names patch (PR#1127), Erik Sigra, 2001/12/23
- [Freeciv-Dev] Re: new natural names patch (PR#1127), Petr Baudis, 2001/12/23
- [Freeciv-Dev] Re: new natural names patch (PR#1127), Erik Sigra, 2001/12/23
- [Freeciv-Dev] Re: new natural names patch (PR#1127), Petr Baudis, 2001/12/23
- [Freeciv-Dev] Re: new natural names patch (PR#1127), Erik Sigra, 2001/12/23
- [Freeciv-Dev] Re: new natural names patch (PR#1127), Jason Short, 2001/12/23
- [Freeciv-Dev] Re: new natural names patch (PR#1127), Erik Sigra, 2001/12/24
- [Freeciv-Dev] Re: new natural names patch (PR#1127), Petr Baudis, 2001/12/24
- [Freeciv-Dev] Re: new natural names patch (PR#1127), Jason Short, 2001/12/22
- [Freeciv-Dev] Re: new natural names patch (PR#1127),
mateusz stefek <=
- [Freeciv-Dev] Re: new natural names patch (PR#1127), Erik Sigra, 2001/12/23
- [Freeciv-Dev] Re: new natural names patch (PR#1127), Gregory Berkolaiko, 2001/12/22
|
|