diff --git a/changelog b/changelog index 8ea39cd7ef6..efadb73f594 100644 --- a/changelog +++ b/changelog @@ -21,6 +21,8 @@ Version 1.13.4+dev: * Weapon filters now support number, parry, accuracy, and movement_used * New [has_attack] in standard unit filters; supercedes has_weapon= and uses full weapon filter. + * lua_function=var.member now works in SUF; however, 'var' still needs to + be a global variable. * AiWML: * Simplified aspect syntax which works for all aspects, present and future: * All aspects with simple values can be specified as key=value diff --git a/src/scripting/game_lua_kernel.cpp b/src/scripting/game_lua_kernel.cpp index a1bf10df12b..686b2ed6c19 100644 --- a/src/scripting/game_lua_kernel.cpp +++ b/src/scripting/game_lua_kernel.cpp @@ -4896,7 +4896,8 @@ bool game_lua_kernel::run_filter(char const *name, unit const &u) if (!ui.valid()) return false; // Get the user filter by name. - if(!luaW_getglobal(L, name)) + const std::vector& path = utils::split(name, '.', utils::STRIP_SPACES); + if(!luaW_getglobal(L, path)) { std::string message = std::string() + "function " + name + " not found"; log_error(message.c_str(), "Lua SUF Error");