Made Hornshark Island Lua file an actual Lua file

[ci skip]

Also simplified the Lua contained within. No need to create a local function just to immediately invoke it.
This commit is contained in:
Charles Dang 2017-10-31 09:35:27 +11:00
parent 4ca25f11ca
commit 5f0bdb4c28
3 changed files with 4 additions and 9 deletions

View file

@ -66,7 +66,7 @@
name=prestart
[lua]
code={./2p_Hornshark_Island_lua}
code= << wesnoth.dofile("multiplayer/scenarios/2p_Hornshark_Island.lua") >>
[/lua]
[fire_event]

View file

@ -0,0 +1,3 @@
for i, side in ipairs(wesnoth.get_sides({})) do
wesnoth.set_variable("p" .. tostring(i) .. "_faction", side.faction)
end

View file

@ -1,8 +0,0 @@
<<
local function detect_factions()
for i, side in ipairs(wesnoth.get_sides({})) do
wesnoth.set_variable("p" .. tostring(i) .. "_faction", side.faction)
end
end
detect_factions()
>>