hedgewars/uScript.pas
changeset 3919 76d5b32758d9
parent 3906 c5da430cb3fd
child 3972 93212a97f01a
equal deleted inserted replaced
3918:916ed485daed 3919:76d5b32758d9
   873 end;
   873 end;
   874 
   874 
   875 procedure ScriptLoad(name : shortstring);
   875 procedure ScriptLoad(name : shortstring);
   876 var ret : LongInt;
   876 var ret : LongInt;
   877 begin
   877 begin
   878 ret:= luaL_loadfile(luaState, Str2PChar(name));
   878 ret:= luaL_loadfile(luaState, Str2PChar(Pathz[ptData] + '/' + name));
   879 if ret <> 0 then
   879 if ret <> 0 then
   880     begin
   880     begin
   881     LuaError('Lua: Failed to load ' + name + '(error ' + IntToStr(ret) + ')');
   881     LuaError('Lua: Failed to load ' + name + '(error ' + IntToStr(ret) + ')');
   882     LuaError('Lua: ' + lua_tostring(luaState, -1));
   882     LuaError('Lua: ' + lua_tostring(luaState, -1));
   883     end
   883     end