Lua: improve level testing
Add des.finalize_level() used for testing in conjunction with des.reset_level(). Add nhc.DLB to return 0 or 1 if DLB was defined at compile-time. Change the test_lev.lua to give more informative messages instead of just lua error when required file doesn't exist. Add bigrm-11 to the level tests.
This commit is contained in:
27
src/mklev.c
27
src/mklev.c
@@ -1067,20 +1067,11 @@ mineralize(int kelp_pool, int kelp_moat, int goldprob, int gemprob,
|
||||
}
|
||||
|
||||
void
|
||||
mklev(void)
|
||||
level_finalize_topology(void)
|
||||
{
|
||||
struct mkroom *croom;
|
||||
int ridx;
|
||||
|
||||
reseed_random(rn2);
|
||||
reseed_random(rn2_on_display_rng);
|
||||
|
||||
init_mapseen(&u.uz);
|
||||
if (getbones())
|
||||
return;
|
||||
|
||||
g.in_mklev = TRUE;
|
||||
makelevel();
|
||||
bound_digging();
|
||||
mineralize(-1, -1, -1, -1, FALSE);
|
||||
g.in_mklev = FALSE;
|
||||
@@ -1102,6 +1093,22 @@ mklev(void)
|
||||
entered; g.rooms[].orig_rtype always retains original rtype value */
|
||||
for (ridx = 0; ridx < SIZE(g.rooms); ridx++)
|
||||
g.rooms[ridx].orig_rtype = g.rooms[ridx].rtype;
|
||||
}
|
||||
|
||||
void
|
||||
mklev(void)
|
||||
{
|
||||
reseed_random(rn2);
|
||||
reseed_random(rn2_on_display_rng);
|
||||
|
||||
init_mapseen(&u.uz);
|
||||
if (getbones())
|
||||
return;
|
||||
|
||||
g.in_mklev = TRUE;
|
||||
makelevel();
|
||||
|
||||
level_finalize_topology();
|
||||
|
||||
reseed_random(rn2);
|
||||
reseed_random(rn2_on_display_rng);
|
||||
|
||||
Reference in New Issue
Block a user