finalize_level is only needed for testing purposes */
| 6011 | |
| 6012 | /* finalize_level is only needed for testing purposes */ |
| 6013 | int |
| 6014 | lspo_finalize_level(lua_State *L) |
| 6015 | { |
| 6016 | boolean wtower = In_W_tower(u.ux, u.uy, &u.uz); |
| 6017 | int i; |
| 6018 | |
| 6019 | if (L) |
| 6020 | create_des_coder(); |
| 6021 | |
| 6022 | link_doors_rooms(); |
| 6023 | remove_boundary_syms(); |
| 6024 | |
| 6025 | /* TODO: ensure_way_out() needs rewrite */ |
| 6026 | if (L && gc.coder->check_inaccessibles) |
| 6027 | ensure_way_out(); |
| 6028 | |
| 6029 | map_cleanup(); |
| 6030 | |
| 6031 | /* FIXME: Ideally, we want this call to only cover areas of the map |
| 6032 | * which were not inserted directly by the special level file (see |
| 6033 | * the insect legs on Baalzebub's level, for instance). Since that |
| 6034 | * is currently not possible, we overload the corrmaze flag for this |
| 6035 | * purpose. |
| 6036 | */ |
| 6037 | if (!svl.level.flags.corrmaze) |
| 6038 | wallification(1, 0, COLNO - 1, ROWNO - 1); |
| 6039 | |
| 6040 | if (L) |
| 6041 | flip_level_rnd(gc.coder->allow_flips, FALSE); |
| 6042 | |
| 6043 | count_level_features(); |
| 6044 | |
| 6045 | if (L && gc.coder->solidify) |
| 6046 | solidify_map(); |
| 6047 | |
| 6048 | /* This must be done before premap_detect(), |
| 6049 | * otherwise branch stairs won't be premapped. */ |
| 6050 | fixup_special(); |
| 6051 | |
| 6052 | if (L && gc.coder->premapped) |
| 6053 | premap_detect(); |
| 6054 | |
| 6055 | level_finalize_topology(); |
| 6056 | |
| 6057 | for (i = 0; i < svn.nroom; ++i) { |
| 6058 | fill_special_room(&svr.rooms[i]); |
| 6059 | } |
| 6060 | |
| 6061 | makemap_prepost(FALSE, wtower); |
| 6062 | iflags.lua_testing = FALSE; |
| 6063 | return 0; |
| 6064 | } |
| 6065 | |
| 6066 | DISABLE_WARNING_UNREACHABLE_CODE |
| 6067 |
no test coverage detected