Fix segfault in typed_formula<color_t>::execute
The list had already been destroyed by the time it was indexed.
This commit is contained in:
parent
b5d25135fc
commit
2bbe419a44
1 changed files with 2 additions and 1 deletions
|
@ -231,7 +231,8 @@ inline color_t typed_formula<color_t>::execute(
|
|||
const game_logic::map_formula_callable& variables,
|
||||
game_logic::function_symbol_table* functions) const
|
||||
{
|
||||
const auto& result = game_logic::formula(formula_, functions).evaluate(variables).as_list();
|
||||
const variant v = game_logic::formula(formula_, functions).evaluate(variables);
|
||||
const auto& result = v.as_list();
|
||||
int alpha = result.size() == 4 ? result[3].as_int() : ALPHA_OPAQUE;
|
||||
return color_t(result.at(0).as_int(), result.at(1).as_int(), result.at(2).as_int(), alpha);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue