mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-04 12:46:06 +00:00
Add goto command, teleport to a waypoint
This commit is contained in:
parent
dc18fa745a
commit
5b2d791cf6
3 changed files with 26 additions and 0 deletions
|
|
@ -1098,6 +1098,7 @@ void D_RegisterClientCommands(void)
|
|||
COM_AddCommand("skynum", Command_Skynum_f);
|
||||
COM_AddCommand("weather", Command_Weather_f);
|
||||
COM_AddCommand("grayscale", Command_Grayscale_f);
|
||||
COM_AddCommand("goto", Command_Goto_f);
|
||||
CV_RegisterVar(&cv_renderhitbox);
|
||||
CV_RegisterVar(&cv_devmode_screen);
|
||||
|
||||
|
|
|
|||
|
|
@ -579,6 +579,30 @@ void Command_Grayscale_f(void)
|
|||
COM_ImmedExecute("toggle palette \"\" GRAYPAL");
|
||||
}
|
||||
|
||||
void Command_Goto_f(void)
|
||||
{
|
||||
const INT32 id = atoi(COM_Argv(1));
|
||||
const waypoint_t *wayp = K_GetWaypointFromID(id);
|
||||
|
||||
REQUIRE_CHEATS;
|
||||
REQUIRE_INLEVEL;
|
||||
|
||||
if (COM_Argc() != 2)
|
||||
{
|
||||
CONS_Printf(M_GetText("goto <waypoint id>: teleport to a waypoint\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (wayp == NULL)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "goto %d: no waypoint with that ID\n", id);
|
||||
return;
|
||||
}
|
||||
|
||||
D_Cheat(consoleplayer, CHEAT_TELEPORT,
|
||||
wayp->mobj->x, wayp->mobj->y, wayp->mobj->z);
|
||||
}
|
||||
|
||||
//
|
||||
// OBJECTPLACE (and related variables)
|
||||
//
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ void Command_RTeleport_f(void);
|
|||
void Command_Skynum_f(void);
|
||||
void Command_Weather_f(void);
|
||||
void Command_Grayscale_f(void);
|
||||
void Command_Goto_f(void);
|
||||
#ifdef _DEBUG
|
||||
void Command_CauseCfail_f(void);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue