diff --git a/include/extern.h b/include/extern.h index 49ed2ec6a..1c9c9af6d 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1201,6 +1201,7 @@ E boolean FDECL(bad_location, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P)); E void FDECL(place_lregion, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, d_level *)); +E void NDECL(fixup_special); E void NDECL(fumaroles); E void NDECL(movebubbles); E void NDECL(water_friction); diff --git a/src/mkmaze.c b/src/mkmaze.c index f192a3f3c..246dafea4 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -19,7 +19,6 @@ STATIC_DCL void FDECL(maze0xy, (coord *)); STATIC_DCL boolean FDECL(put_lregion_here, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, BOOLEAN_P, d_level *)); -STATIC_DCL void NDECL(fixup_special); STATIC_DCL void NDECL(setup_waterlevel); STATIC_DCL void NDECL(unsetup_waterlevel); @@ -362,7 +361,7 @@ d_level *lev; static boolean was_waterlevel; /* ugh... this shouldn't be needed */ /* this is special stuff that the level compiler cannot (yet) handle */ -STATIC_OVL void +void fixup_special() { register lev_region *r = lregions; @@ -577,7 +576,6 @@ register const char *s; if (*protofile) { Strcat(protofile, LEV_EXT); if (load_special(protofile)) { - fixup_special(); /* some levels can end up with monsters on dead mon list, including light source monsters */ dmonsfree(); diff --git a/src/sp_lev.c b/src/sp_lev.c index 61740b436..79a3bbcc8 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -5863,11 +5863,16 @@ sp_lev *lvl; count_features(); - if (coder->premapped) - sokoban_detect(); if (coder->solidify) solidify_map(); + /* This must be done before sokoban_detect(), + * otherwise branch stairs won't be premapped. */ + fixup_special(); + + if (coder->premapped) + sokoban_detect(); + if (coder->frame) { struct sp_frame *tmpframe; do {