check mklev created level sanity */
| 1220 | |
| 1221 | /* check mklev created level sanity */ |
| 1222 | staticfn void |
| 1223 | mklev_sanity_check(void) |
| 1224 | { |
| 1225 | coordxy x, y; |
| 1226 | int i; |
| 1227 | int rmno = -1; |
| 1228 | |
| 1229 | if (!(iflags.sanity_check || iflags.debug_fuzzer)) |
| 1230 | return; |
| 1231 | |
| 1232 | for (y = 0; y < ROWNO; y++) { |
| 1233 | for (x = 1; x < COLNO; x++) { |
| 1234 | if (!chk_okdoor(x,y)) |
| 1235 | impossible("levl[%i][%i] door not ok", x, y); |
| 1236 | } |
| 1237 | } |
| 1238 | |
| 1239 | for (i = 0; i < svn.nroom; i++) { |
| 1240 | if (!svr.rooms[i].needjoining) |
| 1241 | continue; |
| 1242 | if (rmno == -1) |
| 1243 | rmno = gs.smeq[i]; |
| 1244 | if (rmno != -1 && gs.smeq[i] != rmno) |
| 1245 | impossible("room %i not connected?", i); |
| 1246 | } |
| 1247 | } |
| 1248 | |
| 1249 | |
| 1250 | staticfn void |
no test coverage detected