add minor notes from Challenge RE

This commit is contained in:
Martin Michelsen
2026-05-28 08:29:37 -07:00
parent c3aacc2352
commit 3aa58e24b4
3 changed files with 10 additions and 4 deletions
+2 -2
View File
@@ -5220,10 +5220,10 @@ struct G_SetChallengeTime_6x95 {
struct G_SelectChallengeModeFailureOption_6x97 { struct G_SelectChallengeModeFailureOption_6x97 {
G_UnusedHeader header; G_UnusedHeader header;
le_uint32_t unused1 = 0; le_uint32_t client_id = 0;
le_uint32_t is_retry = 0; le_uint32_t is_retry = 0;
le_uint32_t unused1 = 0;
le_uint32_t unused2 = 0; le_uint32_t unused2 = 0;
le_uint32_t unused3 = 0;
} __packed_ws__(G_SelectChallengeModeFailureOption_6x97, 0x14); } __packed_ws__(G_SelectChallengeModeFailureOption_6x97, 0x14);
// 6x98: Unknown // 6x98: Unknown
+3 -1
View File
@@ -1788,9 +1788,11 @@ static const QuestScriptOpcodeDefinition opcode_defs[] = {
// regA = client ID // regA = client ID
{0xF89F, {"player_recovery", "unknownF89F"}, {R_REG}, F_V2_V4}, {0xF89F, {"player_recovery", "unknownF89F"}, {R_REG}, F_V2_V4},
// These opcodes set, clear, and check (respectively) a flag that appears to do nothing at all. // Disables or enables a flag that controls whether the Yes/No menu appears when entering a boss warp.
{0xF8A0, {"disable_bosswarp_option", "unknownF8A0"}, {}, F_V2_V4}, {0xF8A0, {"disable_bosswarp_option", "unknownF8A0"}, {}, F_V2_V4},
{0xF8A1, {"enable_bosswarp_option", "unknownF8A1"}, {}, F_V2_V4}, {0xF8A1, {"enable_bosswarp_option", "unknownF8A1"}, {}, F_V2_V4},
// Gets the value (in regA) of the flag set by the above two opcodes (0 = Yes/No menu enabled, 1 = disabled).
{0xF8A2, {"is_bosswarp_opt_disabled", "get_bosswarp_option"}, {W_REG}, F_V2_V4}, {0xF8A2, {"is_bosswarp_opt_disabled", "get_bosswarp_option"}, {W_REG}, F_V2_V4},
// Loads the player's serial number into the "flag buffer", which is a 4-byte buffer that can be written to event // Loads the player's serial number into the "flag buffer", which is a 4-byte buffer that can be written to event
+5 -1
View File
@@ -4812,7 +4812,7 @@ static asio::awaitable<void> on_request_challenge_grave_recovery_item_bb(std::sh
} }
static asio::awaitable<void> on_challenge_mode_retry_or_quit(std::shared_ptr<Client> c, SubcommandMessage& msg) { static asio::awaitable<void> on_challenge_mode_retry_or_quit(std::shared_ptr<Client> c, SubcommandMessage& msg) {
const auto& cmd = msg.check_size_t<G_SelectChallengeModeFailureOption_6x97>(); auto& cmd = msg.check_size_t<G_SelectChallengeModeFailureOption_6x97>();
auto l = c->require_lobby(); auto l = c->require_lobby();
auto leader_c = l->clients.at(l->leader_id); auto leader_c = l->clients.at(l->leader_id);
@@ -4820,6 +4820,10 @@ static asio::awaitable<void> on_challenge_mode_retry_or_quit(std::shared_ptr<Cli
throw std::runtime_error("6x97 sent by non-leader"); throw std::runtime_error("6x97 sent by non-leader");
} }
// Clear uninitialized memory sent by client
cmd.unused1 = 0;
cmd.unused2 = 0;
if (l->is_game() && (cmd.is_retry == 1) && l->quest && (l->quest->meta.challenge_template_index >= 0)) { if (l->is_game() && (cmd.is_retry == 1) && l->quest && (l->quest->meta.challenge_template_index >= 0)) {
auto s = l->require_server_state(); auto s = l->require_server_state();