# HG changeset patch # User Ritor1 # Date 1384885558 -21600 # Node ID cc197a3b6effdf2e54f30a3b83ffe3d5687e10a3 # Parent e78fa90821743a639962cdaae4e39548826ccda0 GetScriptFileLocation diff -r e78fa9082174 -r cc197a3b6eff mm7_2.cpp --- a/mm7_2.cpp Tue Nov 19 20:23:42 2013 +0600 +++ b/mm7_2.cpp Wed Nov 20 00:25:58 2013 +0600 @@ -4309,6 +4309,14 @@ bool draw_debug_line = false; bool new_speed = true; + +const char *GetScriptFileLocation(const char *script_name) +{ + static char buf[2048]; + strcpy(buf, "scripts/"); + strcat(buf, script_name); + return buf; +} //----- (00462C94) -------------------------------------------------------- bool MM_Main(const wchar_t *pCmdLine) { @@ -4318,20 +4326,19 @@ sprintfex(test, "^Pi[%s]: знахар^R[ь;ка;]", "Золтан"); lua_State *L = luaL_newstate(); - char test2[1024]; if ( L == NULL ) printf ( "Error creating Lua context.\n" ); luaL_openlibs(L); - if ( luaL_dofile(L,"lua_scripts/script.lua")) + if ( luaL_dofile(L,GetScriptFileLocation("script.lua"))) printf ( "Error opening script.lua\n" ); luaopen_test(L); // load the wrappered module - if (luaL_dofile(L,"lua_scripts/test.lua")) - printf("unable to load file"); + if (luaL_dofile(L,GetScriptFileLocation("test.lua"))) + printf("unable to load file\n"); luaopen_UIControl(L); // load the wrappered module - if (luaL_dofile(L,"lua_scripts/UIControl.lua")) - printf("unable to load file"); + if (luaL_dofile(L,GetScriptFileLocation("UIControl.lua"))) + printf("unable to load file\n"); //lua_close(l); bool bNoMargareth = false;