debug-mode extended cmd - panic

Add a debug-mode extended command #panic to call
panic().  Useful for testing panic-savefile generation.
This commit is contained in:
nethack.allison
2002-04-21 13:51:10 +00:00
parent b1c191cf85
commit a277db8f73
3 changed files with 13 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ Debug-Mode Quick Reference:
#levelchange == change experience level
#light sources == show mobile light sources
#monpoly_control == control monster polymorphs
#panic == panic test
#poly == polymorph self
#seenv == show seen vectors
#stats == show memory statistics

View File

@@ -113,3 +113,4 @@ lootabc option
showrace option
travel option
mouse_support wincap option
debug mode: #panic routine to test panic() and panic save file generation

View File

@@ -115,6 +115,7 @@ STATIC_PTR int NDECL(wiz_map);
STATIC_PTR int NDECL(wiz_genesis);
STATIC_PTR int NDECL(wiz_where);
STATIC_PTR int NDECL(wiz_detect);
STATIC_PTR int NDECL(wiz_panic);
STATIC_PTR int NDECL(wiz_polyself);
STATIC_PTR int NDECL(wiz_level_tele);
STATIC_PTR int NDECL(wiz_level_change);
@@ -604,6 +605,14 @@ wiz_level_change()
return 0;
}
STATIC_PTR int
wiz_panic()
{
if (yn("Do you want to call panic() and end your game?") == 'y')
panic("crash test.");
return 0;
}
STATIC_PTR int
wiz_polyself()
{
@@ -1409,6 +1418,7 @@ struct ext_func_tab extcmdlist[] = {
{(char *)0, (char *)0, donull, TRUE},
{(char *)0, (char *)0, donull, TRUE},
{(char *)0, (char *)0, donull, TRUE},
{(char *)0, (char *)0, donull, TRUE},
{(char *)0, (char *)0, donull, TRUE},
{(char *)0, (char *)0, donull, TRUE},
{(char *)0, (char *)0, donull, TRUE},
@@ -1425,6 +1435,7 @@ static const struct ext_func_tab debug_extcmdlist[] = {
{"levelchange", "change experience level", wiz_level_change, TRUE},
{"light sources", "show mobile light sources", wiz_light_sources, TRUE},
{"monpoly_control", "control monster polymorphs", wiz_mon_polycontrol, TRUE},
{"panic", "test panic routine (fatal to game)", wiz_panic, TRUE},
{"poly", "polymorph self", wiz_polyself, TRUE},
{"seenv", "show seen vectors", wiz_show_seenv, TRUE},
{"stats", "show memory statistics", wiz_show_stats, TRUE},