diff --git a/extension.cpp b/extension.cpp index 6f4783b..b2cbebe 100644 --- a/extension.cpp +++ b/extension.cpp @@ -113,12 +113,21 @@ void SourceTVManager::SDK_OnAllLoaded() #endif SM_GET_LATE_IFACE(BINTOOLS, bintools); + if (!bintools) + { + smutils->LogError(myself, "Could not find interface: %s. Won't be able to send events to local spectators only.", SMINTERFACE_BINTOOLS_NAME); + } SM_GET_LATE_IFACE(SDKTOOLS, sdktools); + if (!sdktools) + { + smutils->LogError(myself, "Could not find interface: %s. Some functions won't work.", SMINTERFACE_SDKTOOLS_NAME); + } g_pSTVForwards.Init(); SetupNativeCalls(); - iserver = sdktools->GetIServer(); + if (sdktools) + iserver = sdktools->GetIServer(); if (!iserver) smutils->LogError(myself, "Failed to get IServer interface from SDKTools. Some functions won't work."); diff --git a/hltvserverwrapper.h b/hltvserverwrapper.h index a211fa7..3ffad84 100644 --- a/hltvserverwrapper.h +++ b/hltvserverwrapper.h @@ -35,6 +35,7 @@ #include "extension.h" #include "amtl/am-vector.h" #include "amtl/am-utility.h" +#include "amtl/am-autoptr.h" class HLTVServerWrapper { public: diff --git a/natives.cpp b/natives.cpp index f53e61a..bed1a73 100644 --- a/natives.cpp +++ b/natives.cpp @@ -235,6 +235,9 @@ static bool BroadcastEventLocal(IHLTVServer *server, IGameEvent *event, bool bRe return false; } + if (!bintools) + return false; + PassInfo pass[2]; pass[0].flags = PASSFLAG_BYVAL; pass[0].type = PassType_Basic;