home · contact · privacy
Server/C: Don't update map memory on WORLD_ACTIVE command.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 8 Mar 2015 16:14:53 +0000 (17:14 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 8 Mar 2015 16:14:53 +0000 (17:14 +0100)
src/server/field_of_view.c
src/server/field_of_view.h
src/server/god_commands.c
src/server/init.c
src/server/run.c

index dc60442e3ff28a835d462f5e3ca877b5c938fa2c..45c90e6c0a6f6dc7da76db9938c529f8124076b2 100644 (file)
@@ -308,7 +308,7 @@ static void add_things_to_map_memory(struct Thing * t_eye)
 
 
 
-extern void update_map_memory(struct Thing * t_eye)
+extern void update_map_memory(struct Thing * t_eye, uint8_t age_map)
 {
     if (!t_eye->mem_map)
     {
@@ -330,7 +330,8 @@ extern void update_map_memory(struct Thing * t_eye)
             }
             continue;
         }
-        if (   '0' <= t_eye->mem_depth_map[i] && '9' > t_eye->mem_depth_map[i]
+        if (age_map &&
+            '0' <= t_eye->mem_depth_map[i] && '9' > t_eye->mem_depth_map[i]
             && !(rrand() % (uint16_t) pow(2, t_eye->mem_depth_map[i] - 48)))
         {
             t_eye->mem_depth_map[i]++;
index 54ffe289d676eba9360c79950d36f94889710dfa..be6324bff170c8a9bdc2babd622edf6fc4cd2c63 100644 (file)
@@ -18,7 +18,7 @@ struct Thing;
 /* Update "t_eye"'s .mem_map memory with what's in its current FOV, and update
  * and age the .mem_depth_map.
  */
-extern void update_map_memory(struct Thing * t_eye);
+extern void update_map_memory(struct Thing * t_eye, uint8_t age_map);
 
 /* Build "t"'s field of view. */
 extern void build_fov_map(struct Thing * t);
index d91cea32d01e848d711401f2ff068ac5f1ae7d4b..0dbf1a3ddee552d498383d44c05b5b8915421b74 100644 (file)
@@ -257,7 +257,7 @@ static uint8_t parse_position(char* tok0, char * tok1, struct Thing * t)
                 build_fov_map(t);
                 if (t == get_player())
                 {
-                    update_map_memory(t);
+                    update_map_memory(t, 1);
                 }
             }
         }
@@ -386,7 +386,7 @@ static uint8_t parse_world_active(char * tok0, char * tok1)
                         build_fov_map(ti);
                         if (ti == get_player())
                         {
-                            update_map_memory(ti);
+                            update_map_memory(ti, 0);
                         }
                     }
                 }
index 43a4d685a5477a2a375f9e7c2fc4c08b6f4c5a86..f5c81d3d5081b3ec4ed48f43eeb1801f94f86789 100644 (file)
@@ -209,7 +209,7 @@ extern uint8_t remake_world()
             break;
         }
     }
-    update_map_memory(get_player());
+    update_map_memory(get_player(), 1);
     for (tt = world.thing_types; tt; tt = tt->next)
     {
         if (world.player_type != tt->id)
index 4351b9ffce236b57dd89752a41d87a878fbb5551..ad04f711db0aac65a8d7951779f210136f8d8e97 100644 (file)
@@ -327,7 +327,7 @@ static void turn_over()
             {
                 if (0 == thing->command)
                 {
-                    update_map_memory(thing);
+                    update_map_memory(thing, 1);
                     if (thing == player)
                     {
                         break;