Skip to content

Commit

Permalink
Remove leftover unused UI nested cmd code
Browse files Browse the repository at this point in the history
  • Loading branch information
ensiform committed Mar 7, 2024
1 parent 8a608f6 commit 55b3573
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions src/client/cl_ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ If you have questions concerning this license or the applicable additional terms
#include "client.h"

vm_t *uivm = NULL;
static int nestedCmdOffset; // nested command buffer offset


/*
====================
Expand Down Expand Up @@ -1378,7 +1376,6 @@ CL_InitUI
void CL_InitUI( void ) {
int v;

nestedCmdOffset = 0;

uivm = VM_Create( VM_UI, CL_UISystemCalls, UI_DllSyscall, VMI_NATIVE );
if ( !uivm ) {
Expand All @@ -1403,18 +1400,19 @@ void CL_InitUI( void ) {
v = VM_Call( uivm, 0, UI_GETAPIVERSION );
if ( v != UI_API_VERSION ) {
// Free uivm now, so UI_SHUTDOWN doesn't get called later.
cls.uiStarted = qfalse;
VM_Free( uivm );
uivm = NULL;

Com_Error( ERR_DROP, "User Interface is version %d, expected %d", v, UI_API_VERSION );
cls.uiStarted = qfalse;
}
else {
// init for this gamestate
if ( currentGameMod == GAMEMOD_LEGACY || currentGameMod == GAMEMOD_ETJUMP )
VM_Call( uivm, 3, UI_INIT, ( cls.state >= CA_AUTHORIZING && cls.state < CA_ACTIVE ), qtrue, com_legacyVersion->integer );
else
VM_Call( uivm, 1, UI_INIT, ( cls.state >= CA_AUTHORIZING && cls.state < CA_ACTIVE ) );
}

// init for this gamestate
if ( currentGameMod == GAMEMOD_LEGACY || currentGameMod == GAMEMOD_ETJUMP )
VM_Call( uivm, 3, UI_INIT, ( cls.state >= CA_AUTHORIZING && cls.state < CA_ACTIVE ), qtrue, com_legacyVersion->integer );
else
VM_Call( uivm, 1, UI_INIT, ( cls.state >= CA_AUTHORIZING && cls.state < CA_ACTIVE ) );
}


Expand Down Expand Up @@ -1442,14 +1440,9 @@ See if the current console command is claimed by the ui
====================
*/
qboolean UI_GameCommand( void ) {
qboolean bRes;
if ( !uivm ) {
return qfalse;
}

bRes = (qboolean)VM_Call( uivm, 1, UI_CONSOLE_COMMAND, cls.realtime );

nestedCmdOffset = 0;

return bRes;
return VM_Call( uivm, 1, UI_CONSOLE_COMMAND, cls.realtime );
}

0 comments on commit 55b3573

Please sign in to comment.