metamod/engine_api.cpp
changeset 248 f72386298cba
parent 236 2c14a498e4a7
child 249 0e54d20d8f28
     1.1 --- a/metamod/engine_api.cpp	Fri Feb 18 20:52:34 2005 +0000
     1.2 +++ b/metamod/engine_api.cpp	Tue Aug 23 20:31:28 2005 +0000
     1.3 @@ -452,6 +452,9 @@
     1.4  	META_ENGINE_HANDLE(int, 0, FN_REGUSERMSG, pfnRegUserMsg, (pszName, iSize));
     1.5  	// Expand the macro, since we need to do extra work.
     1.6  	/// RETURN_API()
     1.7 +	if (--CALL_API_count>0)
     1.8 +		/*Restore backup*/
     1.9 +		PublicMetaGlobals = backup_meta_globals;
    1.10  	if(status==MRES_OVERRIDE) {
    1.11  		META_DEBUG(loglevel, ("Returning (override) %s()", pfn_string));
    1.12  		imsgid=override_ret;
    1.13 @@ -860,6 +863,19 @@
    1.14  	RETURN_API_void()
    1.15  }
    1.16  
    1.17 +//Added 2005/08/11 (no SDK update)
    1.18 +void mm_QueryClientCvarValue(const edict_t *pEdict, const char *cvarName)
    1.19 +{
    1.20 +	//Engine version didn't change when this API was added.  Check if pointer is valid.
    1.21 +	if (g_engfuncs.pfnQueryClientCvarValue && 
    1.22 +		!IS_VALID_PTR((void *)g_engfuncs.pfnQueryClientCvarValue))
    1.23 +		g_engfuncs.pfnQueryClientCvarValue = 0;
    1.24 +
    1.25 +	g_Players.set_player_cvar_query(pEdict, cvarName);
    1.26 +
    1.27 +	META_ENGINE_HANDLE_void(FN_QUERYCLIENTCVARVALUE, pfnQueryClientCvarValue, (pEdict, cvarName));
    1.28 +	RETURN_API_void();
    1.29 +}
    1.30  
    1.31  enginefuncs_t meta_engfuncs = {
    1.32  	mm_PrecacheModel,			// pfnPrecacheModel()
    1.33 @@ -1064,4 +1080,9 @@
    1.34  	mm_ProcessTutorMessageDecayBuffer,	// pfnProcessTutorMessageDecayBuffer()
    1.35  	mm_ConstructTutorMessageDecayBuffer,	// pfnConstructTutorMessageDecayBuffer()
    1.36  	mm_ResetTutorMessageDecayData,		// pfnResetTutorMessageDecayData()
    1.37 +
    1.38 +	//Added 2005/08/11 (no SDK update)
    1.39 +	mm_QueryClientCvarValue,		// pfnQueryClientCvarValue()
    1.40  };
    1.41 +
    1.42 +