Have SDKTools use IServerTools to get ent facts where available (bug 5968, r=asherkin).
Have SDKTools use IServerTools to get ent facts where available (
bug 5968, r=asherkin).
1.1 --- a/extensions/sdktools/vhelpers.cpp Tue Oct 29 18:59:12 2013 -0400
1.2 +++ b/extensions/sdktools/vhelpers.cpp Tue Oct 29 18:59:36 2013 -0400
1.3 @@ -521,6 +521,12 @@
1.4 return;
1.5 }
1.6
1.7 + CEntityFactoryDictionary *dict = NULL;
1.8 +
1.9 +#if SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_SDK2013
1.10 + dict = (CEntityFactoryDictionary *)servertools->GetEntityFactoryDictionary();
1.11 +#else
1.12 +
1.13 ICallWrapper *pWrapper = NULL;
1.14
1.15 if (!pWrapper)
1.16 @@ -540,21 +546,13 @@
1.17 pWrapper = g_pBinTools->CreateCall(addr, CallConv_Cdecl, &retData, NULL, 0);
1.18 }
1.19
1.20 -
1.21 - void *returnData = NULL;
1.22 -
1.23 - pWrapper->Execute(NULL, &returnData);
1.24 + pWrapper->Execute(NULL, &dict);
1.25
1.26 pWrapper->Destroy();
1.27
1.28 - if (returnData == NULL)
1.29 - {
1.30 - return;
1.31 - }
1.32 +#endif
1.33
1.34 - CEntityFactoryDictionary *dict = ( CEntityFactoryDictionary * )returnData;
1.35 -
1.36 - if ( !dict )
1.37 + if (dict == NULL)
1.38 {
1.39 return;
1.40 }