replace UnlockAllAreas and PreventPersistQuestFlags with generalized rewrite map

This commit is contained in:
Martin Michelsen
2024-03-30 22:35:34 -07:00
parent 7c7df39e6d
commit 4a3b0118a8
13 changed files with 209 additions and 130 deletions
+3 -3
View File
@@ -350,7 +350,7 @@ shared_ptr<const TeamIndex::Team> Client::team() const {
}
bool Client::evaluate_quest_availability_expression(
shared_ptr<const QuestAvailabilityExpression> expr,
shared_ptr<const IntegralExpression> expr,
shared_ptr<const Lobby> game,
uint8_t event,
uint8_t difficulty,
@@ -366,8 +366,8 @@ bool Client::evaluate_quest_availability_expression(
throw logic_error("quest flags are missing from game");
}
auto p = this->character();
QuestAvailabilityExpression::Env env = {
.flags = (game && !game->quest_flags_known) ? &game->quest_flag_values->data.at(difficulty) : &p->quest_flags.data.at(difficulty),
IntegralExpression::Env env = {
.flags = &p->quest_flags.data.at(difficulty),
.challenge_records = &p->challenge_records,
.team = this->team(),
.num_players = num_players,