diff --git a/src/scripts/eressea.lua b/src/scripts/eressea.lua index 61548cd64..37d7f855a 100644 --- a/src/scripts/eressea.lua +++ b/src/scripts/eressea.lua @@ -1,15 +1,19 @@ +function loadscript(name) + local script = scriptpath .. "/" .. name + print("- loading " .. script) + if pcall(dofile, script)==0 then + print("Could not load " .. script) + end +end + function run_scripts() scripts = { - "wedding-jadee.lua", "eternath.lua", + "wedding-jadee.lua", "ponnuki.lua" } for index in scripts do - local script = scriptpath .. "/" .. scripts[index] - print("- loading " .. script) - if pcall(dofile, script)==0 then - print("Could not load " .. script) - end + loadscript(scripts[index]) end end diff --git a/src/scripts/eternath.lua b/src/scripts/eternath.lua index 82cb2a32b..1220e82a8 100644 --- a/src/scripts/eternath.lua +++ b/src/scripts/eternath.lua @@ -1,5 +1,5 @@ if gate_travel==nil then - dofile("gates.lua") + loadscript("gates.lua") end local function eternath_exchange(b1, b2, size) diff --git a/src/scripts/wedding-jadee.lua b/src/scripts/wedding-jadee.lua index 558ec0631..f7a671c7a 100644 --- a/src/scripts/wedding-jadee.lua +++ b/src/scripts/wedding-jadee.lua @@ -3,7 +3,7 @@ -- are used as age() functions for a building_action with b:addaction("name") if gate_travel==nil then - dofile("gates.lua") + loadscript("gates.lua") end hellgate = nil