mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-21 09:32:01 +00:00
lua_function= in SUF now has limited support for non-global functions
To be precise, the string is considered as a dot-separated list of components.
This commit is contained in:
parent
4c45683d4d
commit
fb6031d6a1
@ -21,6 +21,8 @@ Version 1.13.4+dev:
|
|||||||
* Weapon filters now support number, parry, accuracy, and movement_used
|
* Weapon filters now support number, parry, accuracy, and movement_used
|
||||||
* New [has_attack] in standard unit filters; supercedes has_weapon= and
|
* New [has_attack] in standard unit filters; supercedes has_weapon= and
|
||||||
uses full weapon filter.
|
uses full weapon filter.
|
||||||
|
* lua_function=var.member now works in SUF; however, 'var' still needs to
|
||||||
|
be a global variable.
|
||||||
* AiWML:
|
* AiWML:
|
||||||
* Simplified aspect syntax which works for all aspects, present and future:
|
* Simplified aspect syntax which works for all aspects, present and future:
|
||||||
* All aspects with simple values can be specified as key=value
|
* All aspects with simple values can be specified as key=value
|
||||||
|
@ -4896,7 +4896,8 @@ bool game_lua_kernel::run_filter(char const *name, unit const &u)
|
|||||||
if (!ui.valid()) return false;
|
if (!ui.valid()) return false;
|
||||||
|
|
||||||
// Get the user filter by name.
|
// Get the user filter by name.
|
||||||
if(!luaW_getglobal(L, name))
|
const std::vector<std::string>& path = utils::split(name, '.', utils::STRIP_SPACES);
|
||||||
|
if(!luaW_getglobal(L, path))
|
||||||
{
|
{
|
||||||
std::string message = std::string() + "function " + name + " not found";
|
std::string message = std::string() + "function " + name + " not found";
|
||||||
log_error(message.c_str(), "Lua SUF Error");
|
log_error(message.c_str(), "Lua SUF Error");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user