From 1fe3202f0b7e2f52e50c430caa744b029fd5bcef Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Sat, 2 Feb 2008 12:38:36 +0000 Subject: cleaned up the console code. added the ability to tune the game in runtime. --- src/game/client/gc_hooks.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/game/client/gc_hooks.cpp') diff --git a/src/game/client/gc_hooks.cpp b/src/game/client/gc_hooks.cpp index 3c8d801d..0acd1c41 100644 --- a/src/game/client/gc_hooks.cpp +++ b/src/game/client/gc_hooks.cpp @@ -5,6 +5,7 @@ extern "C" { #include #include + #include }; #include @@ -25,7 +26,7 @@ extern void menu_init(); extern bool menu_active; extern bool menu_game_active; -extern "C" void modc_preinit() +extern "C" void modc_console_init() { client_console_init(); } @@ -109,6 +110,7 @@ extern "C" void modc_predict() // repredict player world_core world; + world.tuning = tuning; int local_cid = -1; // search for players @@ -437,10 +439,15 @@ extern "C" void modc_message(int msg) client_datas[cid].update_render_info(); } + else if(msg == MSG_TUNE_PARAMS) + { + int *params = (int *)&tuning; + for(unsigned i = 0; i < sizeof(tuning_params)/sizeof(int); i++) + params[i] = msg_unpack_int(); + } else if(msg == MSG_WEAPON_PICKUP) { int weapon = msg_unpack_int(); - picked_up_weapon = weapon+1; } else if(msg == MSG_READY_TO_ENTER) -- cgit 1.4.1