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 #9908, fixes #9795. This change is #9908 done `insert_or_assign` instead of an emplace check. Credit to @Mahoyomu for the fix.
This commit is contained in:
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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user