Fix BB EP4 solo quest unlocks

Fix BB EP4 solo quest unlocks and ship-state marking
This commit is contained in:
James Osborne
2026-05-31 10:45:49 -04:00
committed by GitHub
2 changed files with 31 additions and 0 deletions
+14
View File
@@ -405,6 +405,13 @@ bool Client::can_see_quest(
if (!q->has_version_any_language(this->version())) {
return false;
}
if ((this->version() == Version::BB_V4) &&
game &&
(game->mode == GameMode::SOLO) &&
(game->episode == Episode::EP4) &&
(q->meta.episode == Episode::EP4)) {
return true;
}
return this->evaluate_quest_availability_expression(
q->meta.available_expression, game, event, difficulty, num_players, v1_present);
}
@@ -422,6 +429,13 @@ bool Client::can_play_quest(
if ((q->meta.max_players > 0) && (num_players > q->meta.max_players)) {
return false;
}
if ((this->version() == Version::BB_V4) &&
game &&
(game->mode == GameMode::SOLO) &&
(game->episode == Episode::EP4) &&
(q->meta.episode == Episode::EP4)) {
return true;
}
return this->evaluate_quest_availability_expression(
q->meta.enabled_expression, game, event, difficulty, num_players, v1_present);
}
+17
View File
@@ -4409,6 +4409,13 @@ static asio::awaitable<void> on_E5_BB(shared_ptr<Client> c, Channel::Message& ms
}
c->log.info_f("Marked BB character as Test: {}", c->character_filename());
}
if (!enforce_bb_test_ship_lock(c, s->enable_test_mode)) {
c->unload_character(false);
should_send_approve = false;
} else if (!enforce_bb_hardcore_ship_lock(c, s->enable_hardcore_mode)) {
c->unload_character(false);
should_send_approve = false;
}
} catch (const exception& e) {
send_message_box(c, std::format("$C6New character could not be created:\n{}", e.what()));
should_send_approve = false;
@@ -5338,6 +5345,16 @@ shared_ptr<Lobby> create_game_generic(
creator_c->set_flag(Client::Flag::SHOULD_SEND_ARTIFICIAL_FLAG_STATE);
}
if ((creator_c->version() == Version::BB_V4) &&
(game->mode == GameMode::SOLO) &&
(game->episode == Episode::EP4)) {
for (uint16_t flag : {0x0046, 0x0047, 0x0048, 0x02BD, 0x02BE, 0x02BF, 0x02C0, 0x02C1}) {
game->log.info_f("Unlocking BB Episode IV solo area flag {:04X}", flag);
game->quest_flag_values->set(game->difficulty, flag);
}
creator_c->set_flag(Client::Flag::SHOULD_SEND_ARTIFICIAL_FLAG_STATE);
}
game->switch_flags = make_unique<SwitchFlags>();
return game;