From a030983b61cda94adf81b0c334c768e48dcf1b8c Mon Sep 17 00:00:00 2001 From: James Osborne Date: Sun, 31 May 2026 08:42:39 -0400 Subject: [PATCH 1/4] Fix BB EP4 solo quest unlocks and ship-state marking --- src/Client.cc | 14 ++++++++++++++ src/ReceiveCommands.cc | 7 +++++++ 2 files changed, 21 insertions(+) diff --git a/src/Client.cc b/src/Client.cc index 9ea84de9..d1575ce5 100644 --- a/src/Client.cc +++ b/src/Client.cc @@ -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); } diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index 41281dce..b959160b 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -4409,6 +4409,13 @@ static asio::awaitable on_E5_BB(shared_ptr 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; From 1cf5b210caec4b85f77612f2d6f8a37da1074f25 Mon Sep 17 00:00:00 2001 From: James Osborne Date: Sun, 31 May 2026 09:08:41 -0400 Subject: [PATCH 2/4] Unlock BB EP4 solo areas --- src/ReceiveCommands.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index b959160b..6e65c7c4 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -5345,6 +5345,16 @@ shared_ptr 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 : {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(); return game; From 6d9d7cfb9545f79edf4ac09e9c134f5afe5678c9 Mon Sep 17 00:00:00 2001 From: James Osborne Date: Sun, 31 May 2026 09:54:02 -0400 Subject: [PATCH 3/4] Fix BB EP4 solo access and ship-state marking --- src/ReceiveCommands.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index 6e65c7c4..965bc09b 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -5312,6 +5312,20 @@ shared_ptr create_game_generic( } game->load_maps(); // Load free-play maps + if ((creator_c->version() == Version::BB_V4) && + (game->mode == GameMode::SOLO) && + (game->episode == Episode::EP4)) { + for (auto obj_st : game->map_state->iter_object_states(creator_c->version())) { + const auto& obj_v = obj_st->super_obj->version(creator_c->version()); + if (obj_v.set_entry && + (obj_st->super_obj->floor == 0x00) && + (obj_v.set_entry->base_type == 0x0048)) { + obj_st->game_flags |= 0x0001; + game->log.info_f("Unlocked BB Episode IV solo Pioneer 2 warp door K-{:03X}", obj_st->k_id); + } + } + } + // The game's quest flags are inherited from the creator, if known if (creator_c->version() == Version::BB_V4) { game->quest_flag_values = make_unique(p->quest_flags); From 55744dfc9d46328f5f94f49ec3035302c8d7a0cd Mon Sep 17 00:00:00 2001 From: James Osborne Date: Sun, 31 May 2026 10:02:53 -0400 Subject: [PATCH 4/4] Fix BB EP4 solo access and ship-state marking --- src/ReceiveCommands.cc | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index 965bc09b..d4cf9f12 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -5312,20 +5312,6 @@ shared_ptr create_game_generic( } game->load_maps(); // Load free-play maps - if ((creator_c->version() == Version::BB_V4) && - (game->mode == GameMode::SOLO) && - (game->episode == Episode::EP4)) { - for (auto obj_st : game->map_state->iter_object_states(creator_c->version())) { - const auto& obj_v = obj_st->super_obj->version(creator_c->version()); - if (obj_v.set_entry && - (obj_st->super_obj->floor == 0x00) && - (obj_v.set_entry->base_type == 0x0048)) { - obj_st->game_flags |= 0x0001; - game->log.info_f("Unlocked BB Episode IV solo Pioneer 2 warp door K-{:03X}", obj_st->k_id); - } - } - } - // The game's quest flags are inherited from the creator, if known if (creator_c->version() == Version::BB_V4) { game->quest_flag_values = make_unique(p->quest_flags); @@ -5362,7 +5348,7 @@ shared_ptr create_game_generic( if ((creator_c->version() == Version::BB_V4) && (game->mode == GameMode::SOLO) && (game->episode == Episode::EP4)) { - for (uint16_t flag : {0x02BD, 0x02BE, 0x02BF, 0x02C0, 0x02C1}) { + 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); }