1
0
mirror of https://github.com/wesnoth/wesnoth synced 2025-04-26 21:56:23 +00:00

WFL: allow re-defining functions instead of silently failing

Closes , fixes . This change is  done `insert_or_assign` instead of an emplace check. Credit to @Mahoyomu for the fix.
This commit is contained in:
Charles Dang 2025-03-02 10:16:53 -05:00
parent 55dc0a8215
commit 16830f8ab4

@ -1550,7 +1550,7 @@ function_symbol_table::function_symbol_table(const std::shared_ptr<function_symb
void function_symbol_table::add_function(const std::string& name, formula_function_ptr&& fcn)
{
custom_formulas_.emplace(name, std::move(fcn));
custom_formulas_.insert_or_assign(name, std::move(fcn));
}
expression_ptr function_symbol_table::create_function(