From 46e89891e130302aa17fcf9fc1e7a98e47fb48be Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Tue, 29 Oct 2013 18:59:36 -0400 Subject: [PATCH] Have SDKTools use IServerTools to get ent facts where available (bug 5968, r=asherkin). --- extensions/sdktools/vhelpers.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/extensions/sdktools/vhelpers.cpp b/extensions/sdktools/vhelpers.cpp index c18b26e4b..222f5ecf0 100644 --- a/extensions/sdktools/vhelpers.cpp +++ b/extensions/sdktools/vhelpers.cpp @@ -516,6 +516,12 @@ CON_COMMAND(sm_dump_classes, "Dumps the class list as a text file") return; } + CEntityFactoryDictionary *dict = NULL; + +#if SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_HL2DM + dict = (CEntityFactoryDictionary *)servertools->GetEntityFactoryDictionary(); +#else + ICallWrapper *pWrapper = NULL; if (!pWrapper) @@ -535,21 +541,13 @@ CON_COMMAND(sm_dump_classes, "Dumps the class list as a text file") pWrapper = g_pBinTools->CreateCall(addr, CallConv_Cdecl, &retData, NULL, 0); } - - void *returnData = NULL; - - pWrapper->Execute(NULL, &returnData); + pWrapper->Execute(NULL, &dict); pWrapper->Destroy(); - if (returnData == NULL) - { - return; - } +#endif - CEntityFactoryDictionary *dict = ( CEntityFactoryDictionary * )returnData; - - if ( !dict ) + if (dict == NULL) { return; }