home · contact · privacy
Add auto-mapping / map memory.
[plomrogue] / src / server / thing_actions.c
index bcf9e455f4d382d538633f75681f77b6d76d7b3d..40a44ba17ce71dd4ed51a8ae29137b9618edce95 100644 (file)
@@ -142,8 +142,16 @@ static void actor_hits_actor(struct Thing * hitter, struct Thing * hitted)
         if (player == hitted)
         {
             update_log(" You die.");
+            memset(hitted->fov_map, ' ', world.map.length * world.map.length);
             return;
         }
+        else
+        {
+            free(hitted->fov_map);
+            hitted->fov_map = NULL;
+            free(hitted->mem_map);
+            hitted->mem_map = NULL;
+        }
         update_log(" It dies.");
     }
 }
@@ -266,8 +274,7 @@ extern void actor_move(struct Thing * t)
     if (passable)
     {
         set_thing_position(t, target);
-        free(t->fov_map);
-        t->fov_map = build_fov_map(t);
+        build_fov_map(t);
     }
     if (t == get_player())
     {