Check if requests for interfaces succeed
IBinTools might not be available if we're running on a newer SourceMod version than the extension is compiled against.
This commit is contained in:
parent
0a5cab577a
commit
9d07c9d74c
@ -113,11 +113,20 @@ 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();
|
||||
|
||||
if (sdktools)
|
||||
iserver = sdktools->GetIServer();
|
||||
if (!iserver)
|
||||
smutils->LogError(myself, "Failed to get IServer interface from SDKTools. Some functions won't work.");
|
||||
|
@ -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:
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user