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:
@@ -13,6 +13,7 @@ Debug-Mode Quick Reference:
|
|||||||
#levelchange == change experience level
|
#levelchange == change experience level
|
||||||
#light sources == show mobile light sources
|
#light sources == show mobile light sources
|
||||||
#monpoly_control == control monster polymorphs
|
#monpoly_control == control monster polymorphs
|
||||||
|
#panic == panic test
|
||||||
#poly == polymorph self
|
#poly == polymorph self
|
||||||
#seenv == show seen vectors
|
#seenv == show seen vectors
|
||||||
#stats == show memory statistics
|
#stats == show memory statistics
|
||||||
|
|||||||
@@ -113,3 +113,4 @@ lootabc option
|
|||||||
showrace option
|
showrace option
|
||||||
travel option
|
travel option
|
||||||
mouse_support wincap option
|
mouse_support wincap option
|
||||||
|
debug mode: #panic routine to test panic() and panic save file generation
|
||||||
|
|||||||
11
src/cmd.c
11
src/cmd.c
@@ -115,6 +115,7 @@ STATIC_PTR int NDECL(wiz_map);
|
|||||||
STATIC_PTR int NDECL(wiz_genesis);
|
STATIC_PTR int NDECL(wiz_genesis);
|
||||||
STATIC_PTR int NDECL(wiz_where);
|
STATIC_PTR int NDECL(wiz_where);
|
||||||
STATIC_PTR int NDECL(wiz_detect);
|
STATIC_PTR int NDECL(wiz_detect);
|
||||||
|
STATIC_PTR int NDECL(wiz_panic);
|
||||||
STATIC_PTR int NDECL(wiz_polyself);
|
STATIC_PTR int NDECL(wiz_polyself);
|
||||||
STATIC_PTR int NDECL(wiz_level_tele);
|
STATIC_PTR int NDECL(wiz_level_tele);
|
||||||
STATIC_PTR int NDECL(wiz_level_change);
|
STATIC_PTR int NDECL(wiz_level_change);
|
||||||
@@ -604,6 +605,14 @@ wiz_level_change()
|
|||||||
return 0;
|
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
|
STATIC_PTR int
|
||||||
wiz_polyself()
|
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},
|
||||||
{(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},
|
{"levelchange", "change experience level", wiz_level_change, TRUE},
|
||||||
{"light sources", "show mobile light sources", wiz_light_sources, TRUE},
|
{"light sources", "show mobile light sources", wiz_light_sources, TRUE},
|
||||||
{"monpoly_control", "control monster polymorphs", wiz_mon_polycontrol, 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},
|
{"poly", "polymorph self", wiz_polyself, TRUE},
|
||||||
{"seenv", "show seen vectors", wiz_show_seenv, TRUE},
|
{"seenv", "show seen vectors", wiz_show_seenv, TRUE},
|
||||||
{"stats", "show memory statistics", wiz_show_stats, TRUE},
|
{"stats", "show memory statistics", wiz_show_stats, TRUE},
|
||||||
|
|||||||
Reference in New Issue
Block a user