]> granicus.if.org Git - nethack/commitdiff
Remove duplicate wallify_map code
authorPasi Kallinen <paxed@alt.org>
Sun, 6 Dec 2020 16:36:37 +0000 (18:36 +0200)
committerPasi Kallinen <paxed@alt.org>
Sun, 6 Dec 2020 16:36:37 +0000 (18:36 +0200)
include/extern.h
src/mkmap.c
src/sp_lev.c

index b8b73c1ff1c6a167c658b639a3b6cf2e8d946d0b..4fc957d3059516b354507b8b50c147be778e5bef 100644 (file)
@@ -2495,6 +2495,7 @@ E boolean FDECL(create_room, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P,
 E void FDECL(create_secret_door, (struct mkroom *, XCHAR_P));
 E boolean FDECL(dig_corridor, (coord *, coord *, BOOLEAN_P, SCHAR_P, SCHAR_P));
 E void FDECL(fill_special_room, (struct mkroom *));
+E void FDECL(wallify_map, (int, int, int, int));
 E boolean FDECL(load_special, (const char *));
 E xchar FDECL(selection_getpoint, (int, int, struct selectionvar *));
 E struct selectionvar *NDECL(selection_new);
index 14f7973d8749e63de450e8c0052c030a55fc8b43..8100394caeb5c1965898fed2c424a8ddd06dcf5a 100644 (file)
@@ -14,7 +14,6 @@ static schar FDECL(get_map, (int, int, SCHAR_P));
 static void FDECL(pass_one, (SCHAR_P, SCHAR_P));
 static void FDECL(pass_two, (SCHAR_P, SCHAR_P));
 static void FDECL(pass_three, (SCHAR_P, SCHAR_P));
-static void NDECL(wallify_map);
 static void FDECL(join_map, (SCHAR_P, SCHAR_P));
 static void FDECL(finish_map,
                       (SCHAR_P, SCHAR_P, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P));
@@ -247,29 +246,6 @@ boolean anyroom;
         g.max_ry = sy;
 }
 
-/*
- * If we have drawn a map without walls, this allows us to
- * auto-magically wallify it.  Taken from lev_main.c.
- */
-static void
-wallify_map()
-{
-    int x, y, xx, yy;
-
-    for (x = 1; x < COLNO; x++)
-        for (y = 0; y < ROWNO; y++)
-            if (levl[x][y].typ == STONE) {
-                for (yy = y - 1; yy <= y + 1; yy++)
-                    for (xx = x - 1; xx <= x + 1; xx++)
-                        if (isok(xx, yy) && levl[xx][yy].typ == ROOM) {
-                            if (yy != y)
-                                levl[x][y].typ = HWALL;
-                            else
-                                levl[x][y].typ = VWALL;
-                        }
-            }
-}
-
 static void
 join_map(bg_typ, fg_typ)
 schar bg_typ, fg_typ;
@@ -351,7 +327,7 @@ boolean lit, walled, icedpools;
     int i, j;
 
     if (walled)
-        wallify_map();
+        wallify_map(1, 0, COLNO-1, ROWNO-1);
 
     if (lit) {
         for (i = 1; i < COLNO; i++)
index a21fc72abb3ee45a389d67230ce2e448789682bf..6d64c182cbf86ca99dc39994646f6169b22d325e 100755 (executable)
@@ -63,7 +63,6 @@ static boolean FDECL(search_door, (struct mkroom *,
 static void FDECL(create_corridor, (corridor *));
 static struct mkroom *FDECL(build_room, (room *, struct mkroom *));
 static void FDECL(light_region, (region *));
-static void FDECL(wallify_map, (int, int, int, int));
 static void FDECL(maze1xy, (coord *, int));
 static void NDECL(fill_empty_maze);
 static void FDECL(splev_initlev, (lev_init *));
@@ -2740,7 +2739,7 @@ region *tmpregion;
     }
 }
 
-static void
+void
 wallify_map(x1, y1, x2, y2)
 int x1, y1, x2, y2;
 {