- create SW dynamic CCMD `warptocoords`.

This commit is contained in:
Mitchell Richters 2020-07-11 23:09:39 +10:00
parent 38fa10326d
commit 1dc6edfa56
1 changed files with 17 additions and 0 deletions

View File

@ -276,6 +276,21 @@ static int osdcmd_give(CCmdFuncPtr parm)
return CCMD_SHOWHELP; return CCMD_SHOWHELP;
} }
static int osdcmd_warptocoords(CCmdFuncPtr parm)
{
if (parm->numparms != 5)
return OSDCMD_SHOWHELP;
Player->oposx = Player->posx = atoi(parm->parms[0]);
Player->oposy = Player->posy = atoi(parm->parms[1]);
Player->oposz = Player->posz = atoi(parm->parms[2]);
Player->oq16ang = Player->q16ang = Player->camq16ang = fix16_from_int(atoi(parm->parms[3]));
Player->oq16horiz = Player->q16horiz = Player->camq16horiz = fix16_from_int(atoi(parm->parms[4]));
return OSDCMD_OK;
}
int32_t registerosdcommands(void) int32_t registerosdcommands(void)
{ {
C_RegisterFunction("map","map <mapfile>: loads the given map", osdcmd_map); C_RegisterFunction("map","map <mapfile>: loads the given map", osdcmd_map);
@ -291,6 +306,8 @@ int32_t registerosdcommands(void)
// C_RegisterFunction("spawn","spawn <picnum> [palnum] [cstat] [ang] [x y z]: spawns a sprite with the given properties",osdcmd_spawn); // C_RegisterFunction("spawn","spawn <picnum> [palnum] [cstat] [ang] [x y z]: spawns a sprite with the given properties",osdcmd_spawn);
C_RegisterFunction("warptocoords","warptocoords [x] [y] [z] [ang] [horiz]: warps the player to the specified coordinates",osdcmd_warptocoords);
return 0; return 0;
} }