Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2002:
[Freeciv-Dev] [PATCH] use map_set_special, map_clear_special (PR#1312)
Home

[Freeciv-Dev] [PATCH] use map_set_special, map_clear_special (PR#1312)

[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] use map_set_special, map_clear_special (PR#1312)
From: Markus Linnala <maage@xxxxxxxxx>
Date: Sun, 10 Mar 2002 08:09:34 -0800 (PST)

Use map_set_special and map_clear_special instead of changing values directly.

diff -ur -X freeciv/diff_ignore freeciv/server/mapgen.c 
freeciv-special/server/mapgen.c
--- freeciv/server/mapgen.c     Tue Mar  5 12:56:15 2002
+++ freeciv-special/server/mapgen.c     Sun Mar 10 18:05:10 2002
@@ -1395,7 +1395,7 @@
        ) {
       if (!is_hut_close(x,y)) {
        number--;
-       map_get_tile(x,y)->special|=S_HUT;
+       map_set_special(x, y, S_HUT);
        /* Don't add to islands[].goodies because islands[] not
           setup at this point, except for generator>1, but they
           have pre-set starters anyway. */
@@ -1416,10 +1416,10 @@
          if (!is_special_close(x,y)) {
            if (tile_types[ttype].special_1_name[0] != '\0' &&
                (tile_types[ttype].special_2_name[0] == '\0' || 
(myrand(100)<50))) {
-             map_get_tile(x,y)->special|=S_SPECIAL_1;
+             map_set_special(x, y, S_SPECIAL_1);
            }
            else if (tile_types[ttype].special_2_name[0] != '\0') {
-             map_get_tile(x,y)->special|=S_SPECIAL_2;
+             map_set_special(x, y, S_SPECIAL_2);
            }
          }
        }
diff -ur -X freeciv/diff_ignore freeciv/server/unittools.c 
freeciv-special/server/unittools.c
--- freeciv/server/unittools.c  Thu Mar  7 07:24:34 2002
+++ freeciv-special/server/unittools.c  Sun Mar 10 18:05:10 2002
@@ -2418,7 +2418,7 @@
     return ok;
   }
 
-  map_get_tile(punit->x, punit->y)->special^=S_HUT;
+  map_clear_special(punit->x, punit->y, S_HUT);
   send_tile_info(NULL, punit->x, punit->y);
 
   if (game.rgame.hut_overflight==OVERFLIGHT_FRIGHTEN && is_air_unit(punit)) {

-- 
//Markus



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