Skip to content

Commit 14227c0

Browse files
authored
Fix matchmaking_ds bin not being found for gamedata (#1006). (#1028)
1 parent cf0a498 commit 14227c0

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

core/HalfLife2.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050

5151
typedef ICommandLine *(*FakeGetCommandLine)();
5252

53-
#define TIER0_NAME SOURCE_BIN_PREFIX "tier0" SOURCE_BIN_SUFFIX SOURCE_BIN_EXT
54-
#define VSTDLIB_NAME SOURCE_BIN_PREFIX "vstdlib" SOURCE_BIN_SUFFIX SOURCE_BIN_EXT
53+
#define TIER0_NAME FORMAT_SOURCE_BIN_NAME("tier0")
54+
#define VSTDLIB_NAME FORMAT_SOURCE_BIN_NAME("vstdlib")
5555

5656
CHalfLife2 g_HL2;
5757
ConVar *sv_lan = NULL;

core/HalfLife2.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ using namespace SourceMod;
8484
#define SOURCE_BIN_EXT ".so"
8585
#endif
8686

87+
#define FORMAT_SOURCE_BIN_NAME(basename) \
88+
(SOURCE_BIN_PREFIX basename SOURCE_BIN_SUFFIX SOURCE_BIN_EXT)
89+
8790
struct DataTableInfo
8891
{
8992
struct SendPropPolicy

core/logic_bridge.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -627,13 +627,7 @@ void CoreProviderImpl::InitializeBridge()
627627
this->serverFactory = (void *)g_SMAPI->GetServerFactory(false);
628628
this->listeners = SMGlobalClass::head;
629629

630-
char path[PLATFORM_MAX_PATH];
631-
632-
ke::path::Format(path, sizeof(path),
633-
"%s/bin/" PLATFORM_FOLDER "matchmaking_ds" SOURCE_BIN_SUFFIX SOURCE_BIN_EXT,
634-
g_SMAPI->GetBaseDir());
635-
636-
if (ke::RefPtr<ke::SharedLib> mmlib = ke::SharedLib::Open(path, NULL, 0)) {
630+
if (ke::RefPtr<ke::SharedLib> mmlib = ke::SharedLib::Open(FORMAT_SOURCE_BIN_NAME("matchmaking_ds"), NULL, 0)) {
637631
this->matchmakingDSFactory =
638632
mmlib->get<decltype(sCoreProviderImpl.matchmakingDSFactory)>("CreateInterface");
639633
}

0 commit comments

Comments
 (0)