mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-03-22 13:19:40 +01:00
fixed a shutdown crash bug, updated makefile for linux
--HG-- branch : sourcemm-1.6.0 extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/branches/sourcemm-1.6.0%40438
This commit is contained in:
parent
4b9abfe0af
commit
de6a163784
@ -16,9 +16,10 @@ BINARY = server_i486.so
|
||||
HL2PUB = $(HL2SDK)/public
|
||||
HL2LIB = $(HL2SDK)/linux_sdk
|
||||
|
||||
OBJECTS = oslink.cpp metamod_util.cpp metamod.cpp
|
||||
OBJECTS = metamod.cpp metamod_util.cpp metamod_console.cpp metamod_oslink.cpp metamod_plugins.cpp \
|
||||
sourcehook.cpp episode1/console.cpp episode1/provider_ep1.cpp
|
||||
|
||||
LINK = -static-libgcc
|
||||
LINK = $(HL2LIB)/tier1_i486.a vstdlib_i486.so tier0_i486.so -static-libgcc
|
||||
|
||||
INCLUDE = -I. -I$(HL2PUB) -I$(HL2PUB)/dlls -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 \
|
||||
-I$(HL2PUB)/vstdlib -I$(HL2SDK)/tier1 -I$(SMM_ROOT) -I$(SMM_ROOT)/sourcehook
|
||||
@ -33,7 +34,9 @@ endif
|
||||
|
||||
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
|
||||
|
||||
CFLAGS += -D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Wno-non-virtual-dtor -Werror -fPIC -fno-exceptions -fno-rtti -msse
|
||||
CFLAGS += -D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp \
|
||||
-Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca \
|
||||
-Dstrcmpi=strcasecmp -Wall -Wno-non-virtual-dtor -Werror -fPIC -fno-exceptions -fno-rtti -msse
|
||||
|
||||
ifeq "$(GCC_VERSION)" "4"
|
||||
CFLAGS += $(GCC4_FLAGS)
|
||||
@ -46,6 +49,9 @@ $(BIN_DIR)/%.o: %.cpp
|
||||
|
||||
all:
|
||||
mkdir -p $(BIN_DIR)
|
||||
mkdir -p $(BIN_DIR)/episode1
|
||||
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so
|
||||
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so
|
||||
ln -sf $(SMM_ROOT)/sourcehook/sourcehook.cpp sourcehook.cpp
|
||||
$(MAKE) sourcemm
|
||||
rm -rf $(BINARY)
|
||||
@ -60,7 +66,10 @@ debug:
|
||||
default: all
|
||||
|
||||
clean:
|
||||
rm -rf Release/episode1/*.o
|
||||
rm -rf Release/*.o
|
||||
rm -rf Release/$(BINARY)
|
||||
rm -rf Debug/episode1/*.o
|
||||
rm -rf Debug/*.o
|
||||
rm -rf Debug/$(BINARY)
|
||||
|
||||
|
@ -1154,11 +1154,16 @@ void MetamodSource::UnregisterConCmdBase(ISmmPlugin *plugin, ConCommandBase *pCo
|
||||
g_PluginMngr.RemovePluginCvar(plugin, pCommand);
|
||||
}
|
||||
|
||||
CPluginManager::CPlugin *pOrig = g_PluginMngr.FindByAPI(plugin);
|
||||
UnregisterConCommandBase(pOrig ? pOrig->m_Id : 0, pCommand);
|
||||
}
|
||||
|
||||
void MetamodSource::UnregisterConCommandBase(PluginId id, ConCommandBase *pCommand)
|
||||
{
|
||||
PluginIter iter;
|
||||
CPluginManager::CPlugin *pPlugin;
|
||||
List<IMetamodListener *>::iterator event;
|
||||
IMetamodListener *pML;
|
||||
CPluginManager::CPlugin *pOrig = g_PluginMngr.FindByAPI(plugin);
|
||||
for (iter=g_PluginMngr._begin(); iter!=g_PluginMngr._end(); iter++)
|
||||
{
|
||||
pPlugin = (*iter);
|
||||
@ -1176,7 +1181,7 @@ void MetamodSource::UnregisterConCmdBase(ISmmPlugin *plugin, ConCommandBase *pCo
|
||||
event++)
|
||||
{
|
||||
pML = (*event);
|
||||
pML->OnUnlinkConCommandBase(pOrig ? pOrig->m_Id : 0, pCommand);
|
||||
pML->OnUnlinkConCommandBase(id, pCommand);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,6 +74,7 @@ public:
|
||||
public:
|
||||
const char *GetGameBinaryPath();
|
||||
const char *GetPluginsFile();
|
||||
void UnregisterConCommandBase(PluginId id, ConCommandBase *pCommand);
|
||||
};
|
||||
|
||||
void LogMessage(const char *msg, ...);
|
||||
|
@ -489,6 +489,8 @@ bool CPluginManager::_Unload(CPluginManager::CPlugin *pl, bool force, char *erro
|
||||
//Make sure to detach it from sourcehook!
|
||||
g_SourceHook.UnloadPlugin(pl->m_Id);
|
||||
|
||||
pl->m_Events.clear();
|
||||
|
||||
UnregAllConCmds(pl);
|
||||
|
||||
//Clean up the DLL
|
||||
@ -710,22 +712,19 @@ void CPluginManager::RemovePluginCmd(ISmmPlugin *api, ConCommandBase *pCmd)
|
||||
|
||||
void CPluginManager::UnregAllConCmds(CPlugin *pl)
|
||||
{
|
||||
#if 0
|
||||
SourceHook::List<ConCommandBase *>::iterator i;
|
||||
|
||||
/* :TODO: */
|
||||
for (i=pl->m_Cvars.begin(); i!=pl->m_Cvars.end(); i++)
|
||||
{
|
||||
g_SMConVarAccessor.Unregister(pl->m_Id, (*i) );
|
||||
g_Metamod.UnregisterConCommandBase(pl->m_Id, (*i) );
|
||||
}
|
||||
|
||||
pl->m_Cvars.clear();
|
||||
|
||||
for (i=pl->m_Cmds.begin(); i!=pl->m_Cmds.end(); i++)
|
||||
{
|
||||
g_SMConVarAccessor.Unregister(pl->m_Id, (*i) );
|
||||
g_Metamod.UnregisterConCommandBase(pl->m_Id, (*i) );
|
||||
}
|
||||
|
||||
pl->m_Cmds.clear();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user