cc: prevent more than one enable clause per choice

This commit is contained in:
Crypto City 2021-09-22 13:38:42 +00:00
parent 780435ab3e
commit 1eeb66ed57

View File

@ -501,6 +501,11 @@ void set_partial_state_choice_enabled(script_partial_state_t *state)
tfscript_error("Choice condition requires at least one condition");
return;
}
if (!state->choice.enabled.empty())
{
tfscript_error("There must not be more than one choice condition");
return;
}
auto &c = state->expressions.back();
state->choice.enabled.push_back(std::move(c));
state->expressions.pop_back();