From c5b39191225501da124644223a6b0f56678aad7e Mon Sep 17 00:00:00 2001 From: Lukasz Wlasinksi Date: Wed, 8 Dec 2004 23:40:42 +0000 Subject: [PATCH] fixed custom weapons system --- dlls/csx/source/meta_api.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/dlls/csx/source/meta_api.cpp b/dlls/csx/source/meta_api.cpp index 4fc26414..7c48ca74 100755 --- a/dlls/csx/source/meta_api.cpp +++ b/dlls/csx/source/meta_api.cpp @@ -48,6 +48,8 @@ int gmsgSendAudio; int gmsgTextMsg; int gmsgBarTime; +int g_CurrentMsg; + cvar_t init_csstats_maxsize ={"csstats_maxsize","3500", 0 , 3500.0 }; cvar_t init_csstats_reset ={"csstats_reset","0"}; cvar_t init_csstats_rank ={"csstats_rank","0"}; @@ -162,7 +164,7 @@ void ServerDeactivate() { // clear custom weapons info for ( i=MAX_WEAPONS;i= MAX_REG_MSGS ) - msg_type = 0; - function=modMsgs[msg_type]; - endfunction=modMsgsEnd[msg_type]; + mState = 0; + g_CurrentMsg = msg_type; + if ( g_CurrentMsg < 0 || g_CurrentMsg >= MAX_REG_MSGS ) + g_CurrentMsg = 0; + function=modMsgs[g_CurrentMsg]; + endfunction=modMsgsEnd[g_CurrentMsg]; RETURN_META(MRES_IGNORED); } @@ -332,7 +335,6 @@ void TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t * } void OnMetaAttach() { - CVAR_REGISTER (&init_csstats_maxsize); CVAR_REGISTER (&init_csstats_reset); CVAR_REGISTER (&init_csstats_rank);