We need custom script loading function in lua now physfslayer
authorunc0rr
Sat, 17 Nov 2012 00:41:30 +0400
branchphysfslayer
changeset 8043 da083f8d95e6
parent 8040 448d61778ca7
child 8046 4d3415927d2c
We need custom script loading function in lua now
CMakeLists.txt
hedgewars/uScript.pas
misc/physfs/extras/CMakeLists.txt
share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/backstab.lua
share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/dragon.lua
share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/enemy.lua
share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/epil.lua
share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/family.lua
share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/first_blood.lua
share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/journey.lua
share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/queen.lua
share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/shadow.lua
share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/united.lua
share/hedgewars/Data/Missions/Training/Basic_Training_-_Bazooka.lua
share/hedgewars/Data/Missions/Training/Basic_Training_-_Cluster_Bomb.lua
share/hedgewars/Data/Missions/Training/Basic_Training_-_Grenade.lua
share/hedgewars/Data/Missions/Training/Basic_Training_-_Rope.lua
share/hedgewars/Data/Missions/Training/Basic_Training_-_Shotgun.lua
share/hedgewars/Data/Missions/Training/Basic_Training_-_Sniper_Rifle.lua
share/hedgewars/Data/Missions/Training/User_Mission_-_Bamboo_Thicket.lua
share/hedgewars/Data/Missions/Training/User_Mission_-_Dangerous_Ducklings.lua
share/hedgewars/Data/Missions/Training/User_Mission_-_Diver.lua
share/hedgewars/Data/Missions/Training/User_Mission_-_Newton_and_the_Hammock.lua
share/hedgewars/Data/Missions/Training/User_Mission_-_RCPlane_Challenge.lua
share/hedgewars/Data/Missions/Training/User_Mission_-_Rope_Knock_Challenge.lua
share/hedgewars/Data/Missions/Training/User_Mission_-_Spooky_Tree.lua
share/hedgewars/Data/Missions/Training/User_Mission_-_Teamwork.lua
share/hedgewars/Data/Missions/Training/User_Mission_-_That_Sinking_Feeling.lua
share/hedgewars/Data/Missions/Training/User_Mission_-_The_Great_Escape.lua
share/hedgewars/Data/Missions/Training/portal.lua
share/hedgewars/Data/Scripts/Multiplayer/Balanced_Random_Weapon.lua
share/hedgewars/Data/Scripts/Multiplayer/Capture_the_Flag.lua
share/hedgewars/Data/Scripts/Multiplayer/Continental_supplies.lua
share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua
share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua
share/hedgewars/Data/Scripts/Multiplayer/No_Jumping.lua
share/hedgewars/Data/Scripts/Multiplayer/Racer.lua
share/hedgewars/Data/Scripts/Multiplayer/Random_Weapon.lua
share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua
share/hedgewars/Data/Scripts/Multiplayer/The_Specialists.lua
share/hedgewars/Data/Scripts/Multiplayer/Tumbler.lua
share/hedgewars/Data/Scripts/Multiplayer/WxW.lua
--- a/CMakeLists.txt	Sat Nov 17 00:15:30 2012 +0400
+++ b/CMakeLists.txt	Sat Nov 17 00:41:30 2012 +0400
@@ -241,7 +241,6 @@
     add_subdirectory(misc/liblua)
     #linking with liblua.a requires system readline -- this works everywhere, right?
     set(pascal_flags "-k${EXECUTABLE_OUTPUT_PATH}/lib${LUA_LIBRARY}.a" "-k-lreadline" ${pascal_flags})
-    add_dependencies(physfsrwops lua)
 endif()
 
 
--- a/hedgewars/uScript.pas	Sat Nov 17 00:15:30 2012 +0400
+++ b/hedgewars/uScript.pas	Sat Nov 17 00:41:30 2012 +0400
@@ -1794,6 +1794,18 @@
     lc_setaihintsongear:= 0
 end;
 
+
+function lc_hedgewarsscriptload(L : Plua_State) : LongInt; Cdecl;
+begin
+    if lua_gettop(L) <> 1 then
+        begin
+        LuaError('Lua: Wrong number of parameters passed to HedgewarsScriptLoad!');
+        lua_pushnil(L)
+        end
+    else
+        ScriptLoad(lua_tostring(L, 1));
+    lc_hedgewarsscriptload:= 0;
+end;
 ///////////////////
 
 procedure ScriptPrintStack;
@@ -2407,6 +2419,7 @@
 lua_register(luaState, _P'TestRectForObstacle', @lc_testrectforobstacle);
 
 lua_register(luaState, _P'SetGearAIHints', @lc_setaihintsongear);
+lua_register(luaState, _P'HedgewarsScriptLoad', @lc_hedgewarsscriptload);
 
 
 ScriptClearStack; // just to be sure stack is empty
--- a/misc/physfs/extras/CMakeLists.txt	Sat Nov 17 00:15:30 2012 +0400
+++ b/misc/physfs/extras/CMakeLists.txt	Sat Nov 17 00:41:30 2012 +0400
@@ -5,3 +5,5 @@
 include_directories(${CMAKE_SOURCE_DIR}/misc/physfs/src)
 
 add_library(physfsrwops STATIC physfsrwops.c physfslualoader.c)
+
+add_dependencies(physfsrwops lua)
--- a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/backstab.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/backstab.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -1,5 +1,5 @@
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
-loadfile(GetDataPath() .. "Scripts/Animate.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
+HedgewarsScriptLoad("/Scripts/Animate.lua")
 
 -----------------------------Constants---------------------------------
 choiceAccepted = 1
--- a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/dragon.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/dragon.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -1,5 +1,5 @@
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
-loadfile(GetDataPath() .. "Scripts/Animate.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
+HedgewarsScriptLoad("/Scripts/Animate.lua")
 
 -----------------------------Map--------------------------------------
 local map = 
--- a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/enemy.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/enemy.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -1,5 +1,5 @@
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
-loadfile(GetDataPath() .. "Scripts/Animate.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
+HedgewarsScriptLoad("/Scripts/Animate.lua")
 
 
 --------------------------------------------Constants------------------------------------
--- a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/epil.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/epil.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -1,5 +1,5 @@
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
-loadfile(GetDataPath() .. "Scripts/Animate.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
+HedgewarsScriptLoad("/Scripts/Animate.lua")
 
 -----------------------------Constants---------------------------------
 leaksNum = 1
--- a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/family.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/family.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -1,5 +1,5 @@
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
-loadfile(GetDataPath() .. "Scripts/Animate.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
+HedgewarsScriptLoad("/Scripts/Animate.lua")
 
 -----------------------------Map--------------------------------------
 local map = 
--- a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/first_blood.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/first_blood.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -1,5 +1,5 @@
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
-loadfile(GetDataPath() .. "Scripts/Animate.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
+HedgewarsScriptLoad("/Scripts/Animate.lua")
 
 -----------------------------Variables---------------------------------
 startDialogue = {}
--- a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/journey.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/journey.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -1,5 +1,5 @@
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
-loadfile(GetDataPath() .. "Scripts/Animate.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
+HedgewarsScriptLoad("/Scripts/Animate.lua")
 
 --///////////////////////////////CONSTANTS///////////////////////////
 
--- a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/queen.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/queen.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -1,5 +1,5 @@
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
-loadfile(GetDataPath() .. "Scripts/Animate.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
+HedgewarsScriptLoad("/Scripts/Animate.lua")
 
 
 -----------------------------Map--------------------------------------
--- a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/shadow.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/shadow.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -1,5 +1,5 @@
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
-loadfile(GetDataPath() .. "Scripts/Animate.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
+HedgewarsScriptLoad("/Scripts/Animate.lua")
 
 -----------------------------Constants---------------------------------
 startStage = 0
--- a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/united.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/united.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -1,5 +1,5 @@
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
-loadfile(GetDataPath() .. "Scripts/Animate.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
+HedgewarsScriptLoad("/Scripts/Animate.lua")
 
 -----------------------------Constants---------------------------------
 choiceAccept = 1
--- a/share/hedgewars/Data/Missions/Training/Basic_Training_-_Bazooka.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Bazooka.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -13,7 +13,7 @@
 -- about translations.
 -- We can use the function loc(text) to localize a string.
 
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
 
 -- This variable will hold the number of destroyed targets.
 local score = 0
--- a/share/hedgewars/Data/Missions/Training/Basic_Training_-_Cluster_Bomb.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Cluster_Bomb.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -1,4 +1,4 @@
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
 
 local player = nil
 local scored = 0
--- a/share/hedgewars/Data/Missions/Training/Basic_Training_-_Grenade.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Grenade.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -13,7 +13,7 @@
 -- about translations.
 -- We can use the function loc(text) to localize a string.
 
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
 
 -- This variable will hold the number of destroyed targets.
 local score = 0
--- a/share/hedgewars/Data/Missions/Training/Basic_Training_-_Rope.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Rope.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -7,8 +7,8 @@
 --I know there need to be more "tutorial" specefic messages, but I had a hard timer figuring out what to type / what would be the best technical description.
 
 
-loadfile( GetDataPath() .. "Scripts/Locale.lua" )()
-loadfile( GetDataPath() .. "Scripts/Utils.lua" )() -- For the gearIsInBox function, wrote my own, but decided it was a waste to include it
+HedgewarsScriptLoad("/Scripts/Locale.lua")
+HedgewarsScriptLoad("/Scripts/Utils.lua") -- For the gearIsInBox function, wrote my own, but decided it was a waste to include it
 
 local Player = nil -- Pointer to hog created in: onGameInit
 local Target = nil -- Pointer to target hog
--- a/share/hedgewars/Data/Missions/Training/Basic_Training_-_Shotgun.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Shotgun.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -13,7 +13,7 @@
 -- about translations.
 -- We can use the function loc(text) to localize a string.
 
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
 
 -- This variable will hold the number of destroyed targets.
 local score = 0
--- a/share/hedgewars/Data/Missions/Training/Basic_Training_-_Sniper_Rifle.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Sniper_Rifle.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -13,7 +13,7 @@
 -- about translations.
 -- We can use the function loc(text) to localize a string.
 
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
 
 -- This variable will hold the number of destroyed targets.
 local score = 0
--- a/share/hedgewars/Data/Missions/Training/User_Mission_-_Bamboo_Thicket.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Training/User_Mission_-_Bamboo_Thicket.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -1,5 +1,5 @@
 
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
 
 local player = nil 
 local enemy = nil
--- a/share/hedgewars/Data/Missions/Training/User_Mission_-_Dangerous_Ducklings.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Training/User_Mission_-_Dangerous_Ducklings.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -1,5 +1,5 @@
 
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
 
 
 local player = nil -- This variable will point to the hog's gear
--- a/share/hedgewars/Data/Missions/Training/User_Mission_-_Diver.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Training/User_Mission_-_Diver.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -1,5 +1,5 @@
 
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
 
 local player = nil -- This variable will point to the hog's gear
 local enemy = nil
--- a/share/hedgewars/Data/Missions/Training/User_Mission_-_Newton_and_the_Hammock.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Training/User_Mission_-_Newton_and_the_Hammock.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -1,5 +1,5 @@
 
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
 
 local player = nil 
 local enemy = nil
--- a/share/hedgewars/Data/Missions/Training/User_Mission_-_RCPlane_Challenge.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Training/User_Mission_-_RCPlane_Challenge.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -1,4 +1,4 @@
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
 
 local player = nil
 local RCGear = nil
--- a/share/hedgewars/Data/Missions/Training/User_Mission_-_Rope_Knock_Challenge.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Training/User_Mission_-_Rope_Knock_Challenge.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -1,4 +1,4 @@
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
 
 local hhs = {}
 local missionWon = nil
--- a/share/hedgewars/Data/Missions/Training/User_Mission_-_Spooky_Tree.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Training/User_Mission_-_Spooky_Tree.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -1,5 +1,5 @@
 
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
 
 ---------------------------------------------------------------
 
--- a/share/hedgewars/Data/Missions/Training/User_Mission_-_Teamwork.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Training/User_Mission_-_Teamwork.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -1,4 +1,4 @@
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
 
 local player = nil -- This variable will point to the hog's gear
 local p2 = nil
--- a/share/hedgewars/Data/Missions/Training/User_Mission_-_That_Sinking_Feeling.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Training/User_Mission_-_That_Sinking_Feeling.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -1,6 +1,6 @@
 
 
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
 
 local player
 local hh = {}
--- a/share/hedgewars/Data/Missions/Training/User_Mission_-_The_Great_Escape.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Training/User_Mission_-_The_Great_Escape.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -1,4 +1,4 @@
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
 
 local player = nil
 local enemy = nil
--- a/share/hedgewars/Data/Missions/Training/portal.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Missions/Training/portal.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -1,5 +1,5 @@
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
-loadfile(GetDataPath() .. "Scripts/Utils.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
+HedgewarsScriptLoad("/Scripts/Utils.lua")
 
 local MineArray = {}
 local player 
--- a/share/hedgewars/Data/Scripts/Multiplayer/Balanced_Random_Weapon.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Balanced_Random_Weapon.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -1,5 +1,5 @@
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
-loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
+HedgewarsScriptLoad("/Scripts/Tracker.lua")
 
 local weapons = { amGrenade, amClusterBomb, amBazooka, amBee, amShotgun, amMine, amDEagle, amDynamite, amFirePunch, amWhip, amPickHammer, amBaseballBat, amMortar, amCake, amSeduction, amWatermelon, amHellishBomb, amDrill, amBallgun, amRCPlane, amSniperRifle, amMolotov, amBirdy, amBlowTorch, amGasBomb, amFlamethrower, amSMine, amKamikaze }
 
--- a/share/hedgewars/Data/Scripts/Multiplayer/Capture_the_Flag.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Capture_the_Flag.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -75,7 +75,7 @@
 -----------------
 
 -- enable awesome translaction support so we can use loc() wherever we want
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
 
 ---------------------------------------------------------------
 ----------lots of bad variables and things
--- a/share/hedgewars/Data/Scripts/Multiplayer/Continental_supplies.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Continental_supplies.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -10,9 +10,9 @@
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 ]]
 
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
-loadfile(GetDataPath() .. "Scripts/Utils.lua")()
-loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
+HedgewarsScriptLoad("/Scripts/Utils.lua")
+HedgewarsScriptLoad("/Scripts/Tracker.lua")
 
 function int_sqrt(num)
 	temp=num
--- a/share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -51,8 +51,8 @@
 -- added napalm (whoops) to list of possible weapons you can get
 -- hogs no longer recieve airstrike-related weps on border maps
 
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
-loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
+HedgewarsScriptLoad("/Scripts/Tracker.lua")
 
 local airWeapons = 	{amAirAttack, amMineStrike, amNapalm, amDrillStrike --[[,amPiano]]}
 
--- a/share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -52,8 +52,8 @@
 
 --]]
 
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
-loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
+HedgewarsScriptLoad("/Scripts/Tracker.lua")
 
 --[[
     MUTANT SCRIPT
--- a/share/hedgewars/Data/Scripts/Multiplayer/No_Jumping.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Scripts/Multiplayer/No_Jumping.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -2,7 +2,7 @@
 -- NO JUMPING
 --------------------------------
 
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
 
 local specialGear = nil
 
--- a/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -65,7 +65,7 @@
 -- SCRIPT BEGINS
 -----------------------------
 
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
 
 ------------------
 -- Got Variables?
--- a/share/hedgewars/Data/Scripts/Multiplayer/Random_Weapon.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Random_Weapon.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -1,10 +1,10 @@
 -- Random Weapons, example for gameplay scripts
 
 -- Load the library for localisation ("loc" function)
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
 
 -- Load the gear tracker
-loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
+HedgewarsScriptLoad("/Scripts/Tracker.lua")
 
 -- List of available weapons
 local weapons = { amGrenade, amClusterBomb, amBazooka, amBee, amShotgun,
--- a/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -1,6 +1,6 @@
 
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
-loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
+HedgewarsScriptLoad("/Scripts/Tracker.lua")
 
 ---------------------------------------------------
 ---------------------------------------------------
--- a/share/hedgewars/Data/Scripts/Multiplayer/The_Specialists.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Scripts/Multiplayer/The_Specialists.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -52,8 +52,8 @@
 -- balance hog health, maybe
 -- add proper gameflag checking, maybe (so that we can throw in a .cfg and let the users break everything)
 
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
-loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
+HedgewarsScriptLoad("/Scripts/Tracker.lua")
 
 local numhhs = 0
 local hhs = {}
--- a/share/hedgewars/Data/Scripts/Multiplayer/Tumbler.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Tumbler.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -3,8 +3,8 @@
 -- v.0.7.1
 ------------------------------------
 
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
-loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
+HedgewarsScriptLoad("/Scripts/Tracker.lua")
 
 local fMod = 1000000 -- use this for dev and .16+ games
 
--- a/share/hedgewars/Data/Scripts/Multiplayer/WxW.lua	Sat Nov 17 00:15:30 2012 +0400
+++ b/share/hedgewars/Data/Scripts/Multiplayer/WxW.lua	Sat Nov 17 00:41:30 2012 +0400
@@ -54,9 +54,9 @@
 -- GO PONIES, GO PONIES, GO!
 -----------------------------
 
-loadfile(GetDataPath() .. "Scripts/Locale.lua")()
-loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
-loadfile(GetDataPath() .. "Scripts/Utils.lua")()
+HedgewarsScriptLoad("/Scripts/Locale.lua")
+HedgewarsScriptLoad("/Scripts/Tracker.lua")
+HedgewarsScriptLoad("/Scripts/Utils.lua")
 
 -- experimental menu stuff
 local menuIndex = 1