From 40c0953ebc3a9528d83220c375e5e8564eb188c4 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Wed, 20 Dec 2023 16:22:56 -0800 Subject: [PATCH] switch 6xBE and 6xE3 order --- src/ReceiveSubcommands.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ReceiveSubcommands.cc b/src/ReceiveSubcommands.cc index 7d38380e..0334a899 100644 --- a/src/ReceiveSubcommands.cc +++ b/src/ReceiveSubcommands.cc @@ -2731,12 +2731,15 @@ static void on_quest_F960_result_bb(shared_ptr c, uint8_t, uint8_t, cons // have to deal with Meseta here. item.id = l->generate_item_id(c->lobby_client_id); - p->add_item(item); - send_create_inventory_item_to_lobby(c, c->lobby_client_id, item); + // The 6xE3 handler on the client fails if the item already exists, so we + // need to send 6xE3 before we call send_create_inventory_item_to_lobby. G_SetMesetaSlotPrizeResult_BB_6xE3 cmd_6xE3 = {{0xE3, sizeof(G_SetMesetaSlotPrizeResult_BB_6xE3) >> 2, 0x0000}, item}; send_command_t(c, 0x60, 0x00, cmd_6xE3); + p->add_item(item); + send_create_inventory_item_to_lobby(c, c->lobby_client_id, item); + if (c->log.should_log(LogLevel::INFO)) { string name = s->item_name_index->describe_item(c->version(), item); c->log.info("Awarded item %s", name.c_str());