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:
parent
4ca25f11ca
commit
5f0bdb4c28
3 changed files with 4 additions and 9 deletions
|
@ -66,7 +66,7 @@
|
|||
name=prestart
|
||||
|
||||
[lua]
|
||||
code={./2p_Hornshark_Island_lua}
|
||||
code= << wesnoth.dofile("multiplayer/scenarios/2p_Hornshark_Island.lua") >>
|
||||
[/lua]
|
||||
|
||||
[fire_event]
|
||||
|
|
3
data/multiplayer/scenarios/2p_Hornshark_Island.lua
Normal file
3
data/multiplayer/scenarios/2p_Hornshark_Island.lua
Normal file
|
@ -0,0 +1,3 @@
|
|||
for i, side in ipairs(wesnoth.get_sides({})) do
|
||||
wesnoth.set_variable("p" .. tostring(i) .. "_faction", side.faction)
|
||||
end
|
|
@ -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()
|
||||
>>
|
Loading…
Add table
Reference in a new issue