From 76f64ff95d9475cf2557409b9836c475c83ae793 Mon Sep 17 00:00:00 2001 From: Asmodai Date: Fri, 26 Jan 2018 19:21:37 +0300 Subject: [PATCH] Fix example plugin compilation --- metamod/extra/example/Makefile | 2 +- metamod/extra/example/ex_rehlds_api.h | 6 +----- metamod/extra/example/meta_api.cpp | 4 ++++ 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/metamod/extra/example/Makefile b/metamod/extra/example/Makefile index 03baa29..332596e 100644 --- a/metamod/extra/example/Makefile +++ b/metamod/extra/example/Makefile @@ -9,7 +9,7 @@ OBJECTS = *.cpp LINK = -OPT_FLAGS = -O3 -msse3 -flto -funroll-loops -fomit-frame-pointer -fno-stack-protector +OPT_FLAGS = -O3 -msse3 -flto -funroll-loops -fomit-frame-pointer -fno-stack-protector -fPIC INCLUDE = -I. -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine \ -I$(HLSDK)/game_shared -I$(HLSDK)/pm_shared -I$(HLSDK)/public -I$(METAMOD) diff --git a/metamod/extra/example/ex_rehlds_api.h b/metamod/extra/example/ex_rehlds_api.h index 3555e56..55cfd3a 100644 --- a/metamod/extra/example/ex_rehlds_api.h +++ b/metamod/extra/example/ex_rehlds_api.h @@ -1,9 +1,5 @@ #pragma once -#ifdef __GNUC__ -enum class sv_delta_s; -#endif - #include extern IRehldsApi* g_RehldsApi; @@ -11,4 +7,4 @@ extern const RehldsFuncs_t* g_RehldsFuncs; extern IRehldsHookchains* g_RehldsHookchains; extern IRehldsServerStatic* g_RehldsSvs; -extern bool ex_init_rehlds_api(); +extern bool meta_init_rehlds_api(); diff --git a/metamod/extra/example/meta_api.cpp b/metamod/extra/example/meta_api.cpp index 70757c1..91e1a74 100644 --- a/metamod/extra/example/meta_api.cpp +++ b/metamod/extra/example/meta_api.cpp @@ -1,5 +1,6 @@ #include #include +#include "ex_rehlds_api.h" meta_globals_t *gpMetaGlobals; gamedll_funcs_t *gpGamedllFuncs; @@ -45,6 +46,9 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, m g_engfuncs.pfnServerPrint("\n################\n# Hello World! #\n################\n\n"); + if (meta_init_rehlds_api()) + g_engfuncs.pfnServerPrint("ReHLDS API successfully initialized.\n"); + memcpy(pFunctionTable, &gMetaFunctionTable, sizeof(META_FUNCTIONS)); return TRUE; }