Force 'Cbuf_GetCurrentPlayer()' inline

FORCEINLINE will compile this down to an immediate.
This commit is contained in:
Kawe Mazidjatari 2023-07-22 21:15:01 +02:00
parent 21f64bc572
commit af81954b7f
2 changed files with 9 additions and 11 deletions

View File

@ -3,16 +3,6 @@
#include "tier1/cvar.h" #include "tier1/cvar.h"
#include "engine/cmd.h" #include "engine/cmd.h"
//-----------------------------------------------------------------------------
// Purpose: Returns current player calling this function
// Output : ECommandTarget_t -
//-----------------------------------------------------------------------------
ECommandTarget_t Cbuf_GetCurrentPlayer(void)
{
// Always returns 'CBUF_FIRST_PLAYER' in Respawn's code.
return ECommandTarget_t::CBUF_FIRST_PLAYER;
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Purpose: Sends the entire command line over to the server // Purpose: Sends the entire command line over to the server
// Input : *args - // Input : *args -

View File

@ -1,7 +1,15 @@
#ifndef CMD_H #ifndef CMD_H
#define CMD_H #define CMD_H
ECommandTarget_t Cbuf_GetCurrentPlayer(void); //-----------------------------------------------------------------------------
// Purpose: Returns current player calling this function
// Output : ECommandTarget_t -
//-----------------------------------------------------------------------------
FORCEINLINE ECommandTarget_t Cbuf_GetCurrentPlayer(void)
{
// Always returns 'CBUF_FIRST_PLAYER' in Respawn's code.
return ECommandTarget_t::CBUF_FIRST_PLAYER;
}
/* ==== COMMAND_BUFFER ================================================================================================================================================== */ /* ==== COMMAND_BUFFER ================================================================================================================================================== */
inline CMemory p_Cbuf_AddText; inline CMemory p_Cbuf_AddText;