handle rejected tekker results properly

This commit is contained in:
Martin Michelsen
2023-11-15 18:14:04 -08:00
parent c896c11f57
commit b492a2fac6
4 changed files with 20 additions and 22 deletions
+1 -8
View File
@@ -2180,18 +2180,11 @@ void send_pick_up_item(shared_ptr<Client> c, uint32_t item_id, uint8_t floor) {
send_command_t(l, 0x60, 0x00, cmd);
}
void send_create_inventory_item(shared_ptr<Client> c, const ItemData& item, bool has_newest_item_id) {
void send_create_inventory_item(shared_ptr<Client> c, const ItemData& item) {
auto l = c->require_lobby();
if (c->version() != GameVersion::BB) {
throw logic_error("6xBE can only be sent to BB clients");
}
// This command consumes an item ID on the client even though it's never used,
// because the passed-in item's ID overwrites it. If the passed-in ID was just
// generated by calling l->generate_item_id, then we shouldn't waste one here,
// but if not, we should (to keep our state in sync with the client).
if (!has_newest_item_id) {
l->generate_item_id(c->lobby_client_id);
}
uint16_t client_id = c->lobby_client_id;
G_CreateInventoryItem_BB_6xBE cmd = {{0xBE, 0x07, client_id}, item, 0};
send_command_t(l, 0x60, 0x00, cmd);