Add goto_skybox command, teleport to skybox viewpoint

This commit is contained in:
James R. 2023-09-08 16:17:20 -07:00
parent 79c4074499
commit ddb0c65455
3 changed files with 19 additions and 0 deletions

View file

@ -551,6 +551,7 @@ void D_RegisterClientCommands(void)
COM_AddDebugCommand("goto", Command_Goto_f);
COM_AddDebugCommand("angle", Command_Angle_f);
COM_AddDebugCommand("respawnat", Command_RespawnAt_f);
COM_AddDebugCommand("goto_skybox", Command_GotoSkybox_f);
{
extern struct CVarList *cvlist_player;

View file

@ -640,6 +640,23 @@ void Command_RespawnAt_f(void)
D_Cheat(consoleplayer, CHEAT_RESPAWNAT, atoi(COM_Argv(1)));
}
void Command_GotoSkybox_f(void)
{
REQUIRE_CHEATS;
REQUIRE_INLEVEL;
mobj_t *skybox = players[consoleplayer].skybox.viewpoint;
if (P_MobjWasRemoved(skybox))
{
CONS_Printf("There is no visible skybox for local Player 1.\n");
return;
}
D_Cheat(consoleplayer, CHEAT_TELEPORT, skybox->x, skybox->y, skybox->z);
D_Cheat(consoleplayer, CHEAT_ANGLE, skybox->angle);
}
//
// OBJECTPLACE (and related variables)
//

View file

@ -91,6 +91,7 @@ void Command_Grayscale_f(void);
void Command_Goto_f(void);
void Command_Angle_f(void);
void Command_RespawnAt_f(void);
void Command_GotoSkybox_f(void);
#ifdef _DEBUG
void Command_CauseCfail_f(void);
#endif