diff --git a/Source/d_event.h b/Source/d_event.h index f60ee322..7cb70405 100644 --- a/Source/d_event.h +++ b/Source/d_event.h @@ -73,7 +73,8 @@ typedef enum ga_completed, ga_victory, ga_worlddone, - ga_screenshot + ga_screenshot, + ga_reloadlevel, } gameaction_t; @@ -111,6 +112,9 @@ typedef enum // Savegame slot numbers occupy the second byte of buttons. BTS_SAVEMASK = (4+8+16), BTS_SAVESHIFT = 2, + + // Reload level. + BTS_RELOAD = 32, } buttoncode_t; diff --git a/Source/g_game.c b/Source/g_game.c index e41455d6..6cd067bd 100644 --- a/Source/g_game.c +++ b/Source/g_game.c @@ -93,6 +93,7 @@ int timelimit; boolean paused; boolean sendpause; // send a pause event next tic boolean sendsave; // send a save event next tic +boolean sendreload; // send a reload level event next tic boolean usergame; // ok to save / end game boolean timingdemo; // if true, exit with report on completion boolean fastdemo; // if true, run at full speed -- killough @@ -508,6 +509,12 @@ void G_BuildTiccmd(ticcmd_t* cmd) cmd->buttons = BT_SPECIAL | BTS_SAVEGAME | (savegameslot<buttons = BT_SPECIAL | BTS_RELOAD; + } + // low-res turning if (lowres_turn) @@ -664,6 +671,37 @@ static void G_DoLoadLevel(void) } } +extern int ddt_cheating; + +static void G_ReloadLevel(void) +{ + int i; + + if (demorecording || netgame) + { + gamemap = startmap; + gameepisode = startepisode; + } + + if (demorecording) + { + ddt_cheating = 0; + G_CheckDemoStatus(); + G_RecordDemo(orig_demoname); + G_BeginRecording(); + } + + // force players to be initialized upon first level load + for (i = 0; i