Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't flush the tree when evaluating the *-argument conditionals #2947

Merged
merged 1 commit into from
Dec 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions code/parse/sexp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9542,9 +9542,6 @@ int test_argument_nodes_for_condition(int n, int condition_node, int *num_true,
// only eval this argument if it's valid
if (Sexp_nodes[n].flags & SNF_ARGUMENT_VALID)
{
// flush conditional to avoid short-circuiting
flush_sexp_tree(condition_node);

// evaluate conditional for current argument
Sexp_replacement_arguments.emplace_back(Sexp_nodes[n].text, n);
val = eval_sexp(condition_node);
Expand Down Expand Up @@ -9626,9 +9623,6 @@ int test_argument_vector_for_condition(const SCP_vector<std::pair<char*, int>> &
{
// since we can't see or modify the validity, assume all are valid
{
// flush conditional to avoid short-circuiting
flush_sexp_tree(condition_node);

// evaluate conditional for current argument
Sexp_replacement_arguments.push_back(argument);
val = eval_sexp(condition_node);
Expand Down Expand Up @@ -9838,9 +9832,8 @@ int eval_random_of(int arg_handler_node, int condition_node, bool multiple)
val = SEXP_FALSE;
if (Sexp_nodes[n].flags & SNF_ARGUMENT_VALID)
{
// flush stuff
// ensure special argument list is empty
Sexp_applicable_argument_list.clear_nesting_level();
flush_sexp_tree(condition_node);

// evaluate conditional for current argument
Sexp_replacement_arguments.emplace_back(Sexp_nodes[n].text, n);
Expand Down Expand Up @@ -9891,9 +9884,8 @@ int eval_in_sequence(int arg_handler_node, int condition_node)
// Only execute if the argument is valid (if all nodes were invalid we would still reach this point)
if (Sexp_nodes[n].flags & SNF_ARGUMENT_VALID)
{
// flush stuff
// ensure special argument list is empty
Sexp_applicable_argument_list.clear_nesting_level();
flush_sexp_tree(condition_node);

// evaluate conditional for current argument
Sexp_replacement_arguments.emplace_back(Sexp_nodes[n].text, n);
Expand Down