add event conditions in quest visibility
This commit is contained in:
+4
-2
@@ -334,7 +334,7 @@ shared_ptr<const TeamIndex::Team> Client::team() const {
|
||||
return team;
|
||||
}
|
||||
|
||||
bool Client::can_see_quest(shared_ptr<const Quest> q, uint8_t difficulty, size_t num_players) const {
|
||||
bool Client::can_see_quest(shared_ptr<const Quest> q, uint8_t event, uint8_t difficulty, size_t num_players) const {
|
||||
if (this->license && (this->license->flags & License::Flag::DISABLE_QUEST_REQUIREMENTS)) {
|
||||
return true;
|
||||
}
|
||||
@@ -348,13 +348,14 @@ bool Client::can_see_quest(shared_ptr<const Quest> q, uint8_t difficulty, size_t
|
||||
.challenge_records = &p->challenge_records,
|
||||
.team = this->team(),
|
||||
.num_players = num_players,
|
||||
.event = event,
|
||||
};
|
||||
int64_t ret = q->available_expression->evaluate(env);
|
||||
this->log.info("Evaluated quest availability expression %s => %s", expr.c_str(), ret ? "TRUE" : "FALSE");
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool Client::can_play_quest(shared_ptr<const Quest> q, uint8_t difficulty, size_t num_players) const {
|
||||
bool Client::can_play_quest(shared_ptr<const Quest> q, uint8_t event, uint8_t difficulty, size_t num_players) const {
|
||||
if (this->license && (this->license->flags & License::Flag::DISABLE_QUEST_REQUIREMENTS)) {
|
||||
return true;
|
||||
}
|
||||
@@ -368,6 +369,7 @@ bool Client::can_play_quest(shared_ptr<const Quest> q, uint8_t difficulty, size_
|
||||
.challenge_records = &p->challenge_records,
|
||||
.team = this->team(),
|
||||
.num_players = num_players,
|
||||
.event = event,
|
||||
};
|
||||
bool ret = q->enabled_expression->evaluate(env);
|
||||
this->log.info("Evaluating quest enabled expression %s => %s", expr.c_str(), ret ? "TRUE" : "FALSE");
|
||||
|
||||
Reference in New Issue
Block a user