core/sourcemod.cpp
changeset 2726 c96f3fab8211
parent 2632 f297107ad5da
child 2728 96022dad7e53
     1.1 --- a/core/sourcemod.cpp	Wed May 13 16:24:55 2009 -0700
     1.2 +++ b/core/sourcemod.cpp	Wed May 13 21:55:50 2009 -0400
     1.3 @@ -1,8 +1,8 @@
     1.4  /**
     1.5 - * vim: set ts=4 :
     1.6 + * vim: set ts=4 sw=4 :
     1.7   * =============================================================================
     1.8   * SourceMod
     1.9 - * Copyright (C) 2004-2008 AlliedModders LLC.  All rights reserved.
    1.10 + * Copyright (C) 2004-2009 AlliedModders LLC.  All rights reserved.
    1.11   * =============================================================================
    1.12   *
    1.13   * This program is free software; you can redistribute it and/or modify it under
    1.14 @@ -49,6 +49,7 @@
    1.15  #include "DebugReporter.h"
    1.16  #include "Profiler.h"
    1.17  #include "frame_hooks.h"
    1.18 +#include "logic_bridge.h"
    1.19  
    1.20  SH_DECL_HOOK6(IServerGameDLL, LevelInit, SH_NOATTRIB, false, bool, const char *, const char *, const char *, const char *, bool, bool);
    1.21  SH_DECL_HOOK0_void(IServerGameDLL, LevelShutdown, SH_NOATTRIB, false);
    1.22 @@ -166,6 +167,11 @@
    1.23  	g_LibSys.PathFormat(m_SMBaseDir, sizeof(m_SMBaseDir), "%s/%s", g_BaseDir.c_str(), basepath);
    1.24  	g_LibSys.PathFormat(m_SMRelDir, sizeof(m_SMRelDir), "%s", basepath);
    1.25  
    1.26 +	if (!StartLogicBridge(error, maxlength))
    1.27 +	{
    1.28 +		return false;
    1.29 +	}
    1.30 +
    1.31  	/* Initialize CoreConfig to get the SourceMod base path properly - this parses core.cfg */
    1.32  	g_CoreConfig.Initialize();
    1.33  
    1.34 @@ -185,7 +191,7 @@
    1.35  	{
    1.36  		if (error && maxlength)
    1.37  		{
    1.38 -			snprintf(error, maxlength, "%s (failed to load bin/sourcepawn.jit.x86.%s)", 
    1.39 +			UTIL_Format(error, maxlength, "%s (failed to load bin/sourcepawn.jit.x86.%s)", 
    1.40  				myerror,
    1.41  				PLATFORM_LIB_EXT);
    1.42  		}
    1.43 @@ -265,6 +271,8 @@
    1.44  	/* Make the global core identity */
    1.45  	g_pCoreIdent = g_ShareSys.CreateCoreIdentity();
    1.46  
    1.47 +	InitLogicBridge();
    1.48 +
    1.49  	/* Notify! */
    1.50  	SMGlobalClass *pBase = SMGlobalClass::head;
    1.51  	while (pBase)
    1.52 @@ -535,6 +543,7 @@
    1.53  	}
    1.54  
    1.55  	/* Rest In Peace */
    1.56 +	ShutdownLogicBridge();
    1.57  	ShutdownJIT();
    1.58  }
    1.59  
    1.60 @@ -731,8 +740,3 @@
    1.61  
    1.62  SMGlobalClass *SMGlobalClass::head = NULL;
    1.63  
    1.64 -SMGlobalClass::SMGlobalClass()
    1.65 -{
    1.66 -	m_pGlobalClassNext = SMGlobalClass::head;
    1.67 -	SMGlobalClass::head = this;
    1.68 -}