Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. *Read more...*

Feature #880399 ยป 0010-Delete-requirement_vector_contradiction_clean.patch

Sveinung Kvilhaugsvik, 2020-07-07 04:14 AM

View differences:

common/requirements.c
return FALSE;
}
/**********************************************************************//**
Clean up self contradictions from a requirement vector.
When two requirements conflicts the earliest requirement is removed.
This allows requirement adjustment code to append the new requirement(s)
and leave the contradiction clean up to this function.
**************************************************************************/
bool requirement_vector_contradiction_clean(struct requirement_vector *vec)
{
struct req_vec_problem *problem;
bool had_contradiction = FALSE;
problem = req_vec_get_first_contradiction(vec);
while (problem != NULL) {
had_contradiction = TRUE;
fc_assert_ret_val(problem->num_suggested_solutions > 0, TRUE);
req_vec_change_apply(&problem->suggested_solutions[0], vec);
req_vec_problem_free(problem);
problem = req_vec_get_first_contradiction(vec);
}
return had_contradiction;
}
/**********************************************************************//**
Returns TRUE if players are in the same requirements range.
**************************************************************************/
common/requirements.h
bool does_req_contradicts_reqs(const struct requirement *req,
const struct requirement_vector *vec);
bool requirement_vector_contradiction_clean(struct requirement_vector *vec);
bool is_req_active(const struct player *target_player,
const struct player *other_player,
const struct city *target_city,
    (1-1/1)