MCPcopy Index your code
hub / github.com/NetHack/NetHack / nhl_debug_flags

Function nhl_debug_flags

src/nhlua.c:1462–1504  ·  view source on GitHub ↗

set debugging flags. debugging use only, of course. */ nh.debug_flags({ mongen = false, hunger = false, overwrite_stairs = true }); */

Source from the content-addressed store, hash-verified

1460 hunger = false,
1461 overwrite_stairs = true }); */
1462staticfn int
1463nhl_debug_flags(lua_State *L)
1464{
1465 int val;
1466
1467 lcheck_param_table(L);
1468
1469 /* disable monster generation */
1470 val = get_table_boolean_opt(L, "mongen", -1);
1471 if (val != -1) {
1472 iflags.debug_mongen = !(boolean) val; /* value in lua is negated */
1473 if (iflags.debug_mongen) {
1474 struct monst *mtmp, *mtmp2;
1475
1476 for (mtmp = fmon; mtmp; mtmp = mtmp2) {
1477 mtmp2 = mtmp->nmon;
1478 if (DEADMONSTER(mtmp))
1479 continue;
1480 mongone(mtmp);
1481 }
1482 }
1483 }
1484
1485 /* prevent hunger */
1486 val = get_table_boolean_opt(L, "hunger", -1);
1487 if (val != -1) {
1488 iflags.debug_hunger = !(boolean) val; /* value in lua is negated */
1489 }
1490
1491 /* allow overwriting stairs */
1492 val = get_table_boolean_opt(L, "overwrite_stairs", -1);
1493 if (val != -1) {
1494 iflags.debug_overwrite_stairs = (boolean) val;
1495 }
1496
1497 /* prevent pline going out to the UI */
1498 val = get_table_boolean_opt(L, "prevent_pline", -1);
1499 if (val != -1) {
1500 iflags.debug_prevent_pline = (boolean) val;
1501 }
1502
1503 return 0;
1504}
1505
1506/* flip level */
1507/* nh.flip_level(n); */

Callers

nothing calls this directly

Calls 3

lcheck_param_tableFunction · 0.85
get_table_boolean_optFunction · 0.85
mongoneFunction · 0.85

Tested by

no test coverage detected