diff --git a/source/blood/src/osdcmd.cpp b/source/blood/src/osdcmd.cpp index 088bf1a41..4dc3de1f4 100644 --- a/source/blood/src/osdcmd.cpp +++ b/source/blood/src/osdcmd.cpp @@ -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 : loads the given map", osdcmd_map); @@ -202,6 +221,8 @@ int32_t registerosdcommands(void) C_RegisterFunction("levelwarp","levelwarp : 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; }