1.1 --- a/sourcemm/sample_mm/SamplePlugin.cpp Mon Aug 14 20:14:02 2006 +0000
1.2 +++ b/sourcemm/sample_mm/SamplePlugin.cpp Tue Aug 15 20:10:12 2006 +0000
1.3 @@ -125,26 +125,14 @@
1.4 RETURN_META_VALUE(MRES_IGNORED, true);
1.5 }
1.6
1.7 -#define GET_V_IFACE(v_factory, v_var, v_type, v_name) \
1.8 - v_var = (v_type *)ismm->VInterfaceMatch(ismm->v_factory(), v_name); \
1.9 - if (!v_var) \
1.10 - { \
1.11 - if (error && maxlen) \
1.12 - { \
1.13 - snprintf(error, maxlen, "Could not find interface: %s", v_name); \
1.14 - } \
1.15 - return false; \
1.16 - }
1.17 -
1.18 -
1.19 bool SamplePlugin::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late)
1.20 {
1.21 PLUGIN_SAVEVARS();
1.22
1.23 - GET_V_IFACE(serverFactory, m_ServerDll, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL);
1.24 - GET_V_IFACE(engineFactory, m_Engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER);
1.25 - GET_V_IFACE(serverFactory, m_ServerClients, IServerGameClients, INTERFACEVERSION_SERVERGAMECLIENTS);
1.26 - GET_V_IFACE(engineFactory, m_GameEventManager, IGameEventManager2, INTERFACEVERSION_GAMEEVENTSMANAGER2);
1.27 + GET_V_IFACE_ANY(serverFactory, m_ServerDll, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL);
1.28 + GET_V_IFACE_CURRENT(engineFactory, m_Engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER);
1.29 + GET_V_IFACE_ANY(serverFactory, m_ServerClients, IServerGameClients, INTERFACEVERSION_SERVERGAMECLIENTS);
1.30 + GET_V_IFACE_CURRENT(engineFactory, m_GameEventManager, IGameEventManager2, INTERFACEVERSION_GAMEEVENTSMANAGER2);
1.31
1.32 META_LOG(g_PLAPI, "Starting plugin.\n");
1.33