mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 20:41:46 +00:00
Add eval command, calls LUA_EvalMath
This commit is contained in:
parent
a2493bb9db
commit
ceab0399de
1 changed files with 16 additions and 0 deletions
|
|
@ -226,6 +226,8 @@ static void Command_Schedule_List(void);
|
||||||
|
|
||||||
static void Command_Automate_Set(void);
|
static void Command_Automate_Set(void);
|
||||||
|
|
||||||
|
static void Command_Eval(void);
|
||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
// CLIENT VARIABLES
|
// CLIENT VARIABLES
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
|
|
@ -745,6 +747,8 @@ void D_RegisterServerCommands(void)
|
||||||
|
|
||||||
COM_AddCommand("automate_set", Command_Automate_Set);
|
COM_AddCommand("automate_set", Command_Automate_Set);
|
||||||
|
|
||||||
|
COM_AddCommand("eval", Command_Eval);
|
||||||
|
|
||||||
// for master server connection
|
// for master server connection
|
||||||
AddMServCommands();
|
AddMServCommands();
|
||||||
|
|
||||||
|
|
@ -6128,6 +6132,18 @@ static void Command_Automate_Set(void)
|
||||||
SendNetXCmd(XD_AUTOMATE, buf, buf_p - buf);
|
SendNetXCmd(XD_AUTOMATE, buf, buf_p - buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void Command_Eval(void)
|
||||||
|
{
|
||||||
|
const char *args = COM_Args();
|
||||||
|
|
||||||
|
if (args)
|
||||||
|
{
|
||||||
|
const fixed_t n = LUA_EvalMath(args);
|
||||||
|
|
||||||
|
CONS_Printf("%f (%d)\n", FixedToFloat(n), n);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Makes a change to ::cv_forceskin take effect immediately.
|
/** Makes a change to ::cv_forceskin take effect immediately.
|
||||||
*
|
*
|
||||||
* \sa Command_SetForcedSkin_f, cv_forceskin, forcedskin
|
* \sa Command_SetForcedSkin_f, cv_forceskin, forcedskin
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue