From 2eea57b27f9a9879e241e2dee9998192189fee9d Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Wed, 10 May 2017 22:50:20 -0400 Subject: [PATCH] Fix registration order of on_load events (fixes #1684) --- data/lua/wml-tags.lua | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/data/lua/wml-tags.lua b/data/lua/wml-tags.lua index cad3f2074cf..f8e3b3ed712 100644 --- a/data/lua/wml-tags.lua +++ b/data/lua/wml-tags.lua @@ -1,11 +1,3 @@ ---! #textdomain wesnoth - -wesnoth.require "wml-flow" -wesnoth.require "wml" --- Note: When adding new WML tags, unless they're very simple, it's preferred to --- add a new file in the "data/lua/wml" directory. The file will then automatically --- be loaded by the above require statement. - local helper = wesnoth.require "helper" local location_set = wesnoth.require "location_set" local utils = wesnoth.require "wml-utils" @@ -23,6 +15,20 @@ function wesnoth.game_events.on_save() return {} end +wesnoth.require "wml-flow" +wesnoth.require "wml" + +--[[ + +Note: When adding new WML tags, unless they're very simple, it's preferred to +add a new file in the "data/lua/wml" directory rather than implementing it in this file. +The file will then automatically be loaded by the above require statement. + +Also note: The above on_load event needs to be registered before any other on_load events. +That means before loading the WML tags via wesnoth.require "wml". + +]] + function wml_actions.sync_variable(cfg) local names = cfg.name or helper.wml_error "[sync_variable] missing required name= attribute." local result = wesnoth.synchronize_choice(