diff options
author | maximius <none@none> | 2009-10-17 15:35:07 -0700 |
---|---|---|
committer | maximius <none@none> | 2009-10-17 15:35:07 -0700 |
commit | 26b5e033ffde3d161382fc9addbfa99738379641 (patch) | |
tree | a344f369ca32945f787a02dee35c3dbe342bed7e /src/game/ScriptCalls.cpp | |
parent | f21f47005dcb6b76e1abc9f35fbcd03eed191bff (diff) |
*Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand)
*Fix a possible crash in Spell::DoAllEffectOnTarget
--HG--
branch : trunk
Diffstat (limited to 'src/game/ScriptCalls.cpp')
-rw-r--r-- | src/game/ScriptCalls.cpp | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/src/game/ScriptCalls.cpp b/src/game/ScriptCalls.cpp index 805a5361063..bc84efd03de 100644 --- a/src/game/ScriptCalls.cpp +++ b/src/game/ScriptCalls.cpp @@ -17,19 +17,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - #ifndef WIN32 #include <dlfcn.h> #endif - #include "Common.h" #include "Platform/Define.h" #include "ScriptCalls.h" #include "World.h" #include "Config/ConfigEnv.h" - ScriptsSet Script=NULL; - void UnloadScriptingModule() { if(Script) @@ -41,23 +37,18 @@ void UnloadScriptingModule() Script = NULL; } } - bool LoadScriptingModule(char const* libName) { ScriptsSet testScript=new _ScriptSet; - std::string name = strlen(libName) ? libName : TRINITY_SCRIPT_NAME; name += TRINITY_SCRIPT_EXT; - testScript->hScriptsLib=TRINITY_LOAD_LIBRARY(name.c_str()); - if(!testScript->hScriptsLib ) { printf("Error loading Scripts Library %s !\n",name.c_str()); delete testScript; return false; } - if( !(testScript->ScriptsInit =(scriptCallScriptsInit )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"ScriptsInit" )) ||!(testScript->OnLogin =(scriptCallOnLogin )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"OnLogin" )) ||!(testScript->OnLogout =(scriptCallOnLogout )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"OnLogout" )) @@ -109,19 +100,14 @@ bool LoadScriptingModule(char const* libName) delete testScript; return false; } - sLog.outString(); sLog.outString( ">>> Scripts Library %s was successfully loaded.\n", name.c_str() ); - //heh we are still there :P we have a valid library //we reload script UnloadScriptingModule(); - Script=testScript; Script->ScriptsInit(sConfig.GetFilename().c_str()); - sWorld.SetScriptsVersion(Script->ScriptsVersion()); - return true; } |