From e606de9a3f0fba1159da671a9c0095b0defc0d35 Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Tue, 27 Sep 2011 22:56:10 +0000 Subject: Allow interpreted VM on pure servers --- src/client/cl_cgame.c | 11 ++++++----- src/client/cl_ui.c | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/client/cl_cgame.c b/src/client/cl_cgame.c index 19fd54b9..00bddcd4 100644 --- a/src/client/cl_cgame.c +++ b/src/client/cl_cgame.c @@ -773,13 +773,14 @@ void CL_InitCGame( void ) { Com_sprintf( cl.mapname, sizeof( cl.mapname ), "maps/%s.bsp", mapname ); // load the dll or bytecode - if ( cl_connectedToPureServer != 0 ) { + interpret = Cvar_VariableValue("vm_cgame"); + if(cl_connectedToPureServer) + { // if sv_pure is set we only allow qvms to be loaded - interpret = VMI_COMPILED; - } - else { - interpret = Cvar_VariableValue( "vm_cgame" ); + if(interpret != VMI_COMPILED && interpret != VMI_BYTECODE) + interpret = VMI_COMPILED; } + cgvm = VM_Create( "cgame", CL_CgameSystemCalls, interpret ); if ( !cgvm ) { Com_Error( ERR_DROP, "VM_Create on cgame failed" ); diff --git a/src/client/cl_ui.c b/src/client/cl_ui.c index 88e0e6d1..35b8bbb6 100644 --- a/src/client/cl_ui.c +++ b/src/client/cl_ui.c @@ -1085,13 +1085,14 @@ void CL_InitUI( void ) { vmInterpret_t interpret; // load the dll or bytecode - if ( cl_connectedToPureServer != 0 ) { + interpret = Cvar_VariableValue("vm_ui"); + if(cl_connectedToPureServer) + { // if sv_pure is set we only allow qvms to be loaded - interpret = VMI_COMPILED; - } - else { - interpret = Cvar_VariableValue( "vm_ui" ); + if(interpret != VMI_COMPILED && interpret != VMI_BYTECODE) + interpret = VMI_COMPILED; } + uivm = VM_Create( "ui", CL_UISystemCalls, interpret ); if ( !uivm ) { Com_Printf( "Failed to find a valid UI vm. The following paths were searched:\n" ); -- cgit