- create Blood dynamic CCMD warptocoords.

* The setting of the player's horizon/viewangle probably still requires work, but warping to pos x/y/z works fine.
This commit is contained in:
Mitchell Richters 2020-07-11 23:05:49 +10:00
parent a9b05eff86
commit b08d571be9

View file

@ -192,6 +192,25 @@ static int osdcmd_levelwarp(CCmdFuncPtr parm)
return CCMD_OK;
}
static int osdcmd_warptocoords(CCmdFuncPtr parm)
{
if (parm->numparms != 5)
return CCMD_SHOWHELP;
PLAYER *pPlayer = &gPlayer[myconnectindex];
pPlayer->pSprite->x = gView->pSprite->x = atoi(parm->parms[0]);
pPlayer->pSprite->y = gView->pSprite->y = atoi(parm->parms[1]);
pPlayer->zView = gView->zView = atoi(parm->parms[2]);
pPlayer->q16ang = gView->q16ang = fix16_from_int(atoi(parm->parms[3]));
pPlayer->q16horiz = gView->q16horiz = fix16_from_int(atoi(parm->parms[4]));
gViewAngle = fix16_from_dbl(atan2(atoi(parm->parms[4]), 100) * (1024. / pi::pi()));
viewBackupView(pPlayer->nPlayer);
return CCMD_OK;
}
int32_t registerosdcommands(void)
{
C_RegisterFunction("map","map <mapname>: loads the given map", osdcmd_map);
@ -202,6 +221,8 @@ int32_t registerosdcommands(void)
C_RegisterFunction("levelwarp","levelwarp <e> <m>: warp to episode 'e' and map 'm'", osdcmd_levelwarp);
C_RegisterFunction("warptocoords","warptocoords [x] [y] [z] [ang] [horiz]: warps the player to the specified coordinates",osdcmd_warptocoords);
return 0;
}