diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index e1115f3d..ff3070df 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -2771,7 +2771,9 @@ static asio::awaitable on_10_main_menu(std::shared_ptr c, uint32_t co_await send_auto_patches_if_needed(c); if (c->version() == Version::BB_V4) { - co_await send_brutal_peeps_hp_patch_bb(c, tier); + // BB must patch all online BattleParam files before room creation/area load. + // PC V2 uses the delayed area-load retry path instead. + co_await send_brutal_peeps_hp_patch_bb(c, tier, true); } co_await enable_save_if_needed(c); send_lobby_list(c); @@ -2785,7 +2787,11 @@ static asio::awaitable on_10_main_menu(std::shared_ptr c, uint32_t case MainMenuItemID::GO_TO_LOBBY: { c->selected_brutal_peeps_tier = -1; co_await send_auto_patches_if_needed(c); - co_await send_brutal_peeps_hp_patch_bb(c, -1); + if (c->version() == Version::BB_V4) { + co_await send_brutal_peeps_hp_patch_bb(c, -1, true); + } else if (c->version() == Version::PC_V2) { + co_await send_brutal_peeps_hp_patch_bb(c, -1); + } co_await enable_save_if_needed(c); send_lobby_list(c); if (is_pre_v1(c->version())) { diff --git a/src/SendCommands.cc b/src/SendCommands.cc index bc3934a8..da074834 100644 --- a/src/SendCommands.cc +++ b/src/SendCommands.cc @@ -777,7 +777,8 @@ static std::string bb_stream_file_data_for_client(std::shared_ptr c) { static std::vector>>> send_brutal_peeps_hp_patch_bb_now( std::shared_ptr c, - int64_t tier) { + int64_t tier, + bool force_all_tables) { std::vector>>> promises; if (c->version() != Version::BB_V4) { @@ -831,25 +832,28 @@ static std::vector bp_filenames; - auto l = c->lobby.lock(); - if (l && l->is_game()) { - switch (l->episode) { - case Episode::EP1: - bp_filenames.emplace_back("BattleParamEntry_on.dat"); - break; - case Episode::EP2: - bp_filenames.emplace_back("BattleParamEntry_lab_on.dat"); - break; - case Episode::EP4: - bp_filenames.emplace_back("BattleParamEntry_ep4_on.dat"); - break; - default: - break; + + if (!force_all_tables) { + auto l = c->lobby.lock(); + if (l && l->is_game()) { + switch (l->episode) { + case Episode::EP1: + bp_filenames.emplace_back("BattleParamEntry_on.dat"); + break; + case Episode::EP2: + bp_filenames.emplace_back("BattleParamEntry_lab_on.dat"); + break; + case Episode::EP4: + bp_filenames.emplace_back("BattleParamEntry_ep4_on.dat"); + break; + default: + break; + } } } - // Before the room exists, we don't know which episode the player will pick. - // Patch all online BB BattleParam tables so EP2/EP4 HP is already scaled before enemies initialize. + // Before the room exists, or when explicitly requested from the BB ship-menu path, + // patch all online BB BattleParam tables before enemies initialize. if (bp_filenames.empty()) { bp_filenames.emplace_back("BattleParamEntry_on.dat"); bp_filenames.emplace_back("BattleParamEntry_lab_on.dat"); @@ -1251,7 +1255,7 @@ static std::vector send_brutal_peeps_hp_patch_bb(std::shared_ptr c, int64_t tier) { +asio::awaitable send_brutal_peeps_hp_patch_bb(std::shared_ptr c, int64_t tier, bool force_all_tables) { try { co_await prepare_client_for_patches(c); @@ -1261,7 +1265,7 @@ asio::awaitable send_brutal_peeps_hp_patch_bb(std::shared_ptr c, i for (size_t attempt = 1; attempt <= max_attempts; attempt++) { auto promises = is_pc_bp_patch ? send_brutal_peeps_hp_patch_pc_now(c, tier) - : send_brutal_peeps_hp_patch_bb_now(c, tier); + : send_brutal_peeps_hp_patch_bb_now(c, tier, force_all_tables); bool any_zero_return = false; bool any_success = false; diff --git a/src/SendCommands.hh b/src/SendCommands.hh index b09c48cc..a54d3ed9 100644 --- a/src/SendCommands.hh +++ b/src/SendCommands.hh @@ -198,7 +198,7 @@ void send_guild_card_header_bb(std::shared_ptr c); void send_guild_card_chunk_bb(std::shared_ptr c, size_t chunk_index); void send_stream_file_index_bb(std::shared_ptr c); void send_stream_file_chunk_bb(std::shared_ptr c, uint32_t chunk_index); -asio::awaitable send_brutal_peeps_hp_patch_bb(std::shared_ptr c, int64_t tier); +asio::awaitable send_brutal_peeps_hp_patch_bb(std::shared_ptr c, int64_t tier, bool force_all_tables = false); void send_approve_player_choice_bb(std::shared_ptr c); void send_complete_player_bb(std::shared_ptr c);