- WH: fixed custom CCMD setup.

This commit is contained in:
Christoph Oelckers 2021-11-25 00:09:59 +01:00
parent 8ad31a03ed
commit acf442f687
3 changed files with 11 additions and 35 deletions

View file

@ -15,29 +15,6 @@ int runningtime;
double oldhoriz;
static int osdcmd_third_person_view(CCmdFuncPtr parm)
{
if (gamestate != GS_LEVEL) return CCMD_OK;
/* if (gViewPos > VIEWPOS_0)
gViewPos = VIEWPOS_0;
else
gViewPos = VIEWPOS_1;
*/
return CCMD_OK;
}
static int osdcmd_coop_view(CCmdFuncPtr parm)
{
if (gamestate != GS_LEVEL) return CCMD_OK;
if (numplayers > 1)
{
pyrn = connectpoint2[pyrn];
if (pyrn < 0) pyrn = connecthead;
}
return CCMD_OK;
}
static int osdcmd_cast_spell(CCmdFuncPtr parm)
{
// There's no more space in the packet so this gets sent as a separate network message.
@ -66,8 +43,6 @@ void cast_spell(int plr, uint8_t** stream, bool skip)
int32_t registerosdcommands(void)
{
//C_RegisterFunction("warptocoords", "warptocoords [x] [y] [z] [ang] (optional) [horiz] (optional): warps the player to the specified coordinates", osdcmd_warptocoords);
C_RegisterFunction("third_person_view", "Switch to third person view", osdcmd_third_person_view);
C_RegisterFunction("coop_view", "Switch player to view from in coop", osdcmd_coop_view);
C_RegisterFunction("cast_spell", "castspell <spellnum> Cast a spell", osdcmd_cast_spell);
//C_RegisterFunction("show_weapon", "Show opponents' weapons", osdcmd_show_weapon);
Net_SetCommandHandler(DEM_SPELL, cast_spell);

View file

@ -578,6 +578,7 @@ void GameInterface::app_init()
C_SetNotifyFontScale(isWh2()? 1 : 0.6);
GameTicRate = TIMERRATE / TICSPERFRAME;
engineInit();
registerosdcommands();
TileFiles.tileMakeWritable(ANILAVA);
TileFiles.tileMakeWritable(HEALTHWATER);

View file

@ -716,17 +716,17 @@ OptionMenu "WeaponsControlMenu" protected
ifgame(Witchaven, Witchaven2)
{
StaticText "CNTRLMNU_SPELLS"
Control "$CNTRLMNU_SPELL0" , "spell 0"
Control "$CNTRLMNU_SPELL1" , "spell 1"
Control "$CNTRLMNU_SPELL2" , "spell 2"
Control "$CNTRLMNU_SPELL3" , "spell 3"
Control "$CNTRLMNU_SPELL4" , "spell 4"
Control "$CNTRLMNU_SPELL5" , "spell 5"
Control "$CNTRLMNU_SPELL6" , "spell 6"
Control "$CNTRLMNU_SPELL7" , "spell 7"
Control "$CNTRLMNU_SPELL0" , "cast_spell 0"
Control "$CNTRLMNU_SPELL1" , "cast_spell 1"
Control "$CNTRLMNU_SPELL2" , "cast_spell 2"
Control "$CNTRLMNU_SPELL3" , "cast_spell 3"
Control "$CNTRLMNU_SPELL4" , "cast_spell 4"
Control "$CNTRLMNU_SPELL5" , "cast_spell 5"
Control "$CNTRLMNU_SPELL6" , "cast_spell 6"
Control "$CNTRLMNU_SPELL7" , "cast_spell 7"
StaticText ""
Control "$CNTRLMNU_SPELL8" , "spell 8"
Control "$CNTRLMNU_SPELL9" , "spell 9"
Control "$CNTRLMNU_SPELL8" , "cast_spell 8"
Control "$CNTRLMNU_SPELL9" , "cast_spell 9"
}
}