diff --git a/dat/wizhelp b/dat/wizhelp index a025641be..fd81c6939 100644 --- a/dat/wizhelp +++ b/dat/wizhelp @@ -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 diff --git a/doc/fixes34.1 b/doc/fixes34.1 index 466eb9183..93c5cea33 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -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 diff --git a/src/cmd.c b/src/cmd.c index cbedd1569..9ed208846 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -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},