diff --git a/changelog.md b/changelog.md index 07fe4957731e..59eee5efeb8d 100644 --- a/changelog.md +++ b/changelog.md @@ -163,6 +163,8 @@ (issue #3050). * Fixed a crash when using certain invalid color= values. * Fixed: unit halo remained after undoing a recall (issue #3065). + * [change_theme] no longer causes a Lua error when theme= is not specified + instead of explicitly set to an empty string. ## Version 1.13.12 ### Security fixes diff --git a/data/lua/wml-tags.lua b/data/lua/wml-tags.lua index a0ed3a55a74f..28866ea1cf23 100644 --- a/data/lua/wml-tags.lua +++ b/data/lua/wml-tags.lua @@ -920,7 +920,13 @@ function wml_actions.reset_fog(cfg) end function wesnoth.wml_actions.change_theme(cfg) - wesnoth.game_config.theme = cfg.theme + local new_theme = cfg.theme + + if new_theme == nil then + new_theme = "" + end + + wesnoth.game_config.theme = new_theme end function wesnoth.wml_actions.zoom(cfg)