don't use drop command to change item visibility
This commit is contained in:
@@ -4066,7 +4066,7 @@ struct G_CreateInventoryItem_DC_6x2B {
|
||||
struct G_CreateInventoryItem_PC_V3_BB_6x2B : G_CreateInventoryItem_DC_6x2B {
|
||||
uint8_t unused1 = 0;
|
||||
uint8_t unknown_a2 = 0;
|
||||
le_uint16_t unused2 = 0;
|
||||
parray<uint8_t, 2> unused2 = 0;
|
||||
} __packed__;
|
||||
|
||||
// 6x2C: Talk to NPC
|
||||
|
||||
@@ -1216,11 +1216,8 @@ static void on_pick_up_item_generic(
|
||||
}
|
||||
if (fi->visible_to_client(z)) {
|
||||
send_pick_up_item_to_client(lc, client_id, item_id, floor);
|
||||
} else if (lc->version() == Version::BB_V4) {
|
||||
send_create_inventory_item_to_client(lc, client_id, fi->data);
|
||||
} else {
|
||||
send_drop_item_to_channel(s, lc->channel, fi->data, false, lc->floor, lc->x, lc->z, 0xFFFF);
|
||||
send_pick_up_item_to_client(lc, client_id, item_id, floor);
|
||||
send_create_inventory_item_to_client(lc, client_id, fi->data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+13
-7
@@ -2465,11 +2465,20 @@ void send_pick_up_item_to_client(shared_ptr<Client> c, uint8_t client_id, uint32
|
||||
}
|
||||
|
||||
void send_create_inventory_item_to_client(shared_ptr<Client> c, uint8_t client_id, const ItemData& item) {
|
||||
if (c->version() != Version::BB_V4) {
|
||||
throw logic_error("6xBE can only be sent to BB clients");
|
||||
if (c->version() == Version::BB_V4) {
|
||||
G_CreateInventoryItem_BB_6xBE cmd = {{0xBE, 0x07, client_id}, item, 0};
|
||||
send_command_t(c, 0x60, 0x00, cmd);
|
||||
} else {
|
||||
G_CreateInventoryItem_PC_V3_BB_6x2B cmd;
|
||||
cmd.header.subcommand = 0x2B;
|
||||
cmd.header.size = sizeof(cmd) >> 2;
|
||||
cmd.header.client_id = client_id;
|
||||
cmd.item_data = item;
|
||||
cmd.unused1 = 0;
|
||||
cmd.unknown_a2 = 0;
|
||||
cmd.unused2.clear(0);
|
||||
send_command_t(c, 0x60, 0x00, cmd);
|
||||
}
|
||||
G_CreateInventoryItem_BB_6xBE cmd = {{0xBE, 0x07, client_id}, item, 0};
|
||||
send_command_t(c, 0x60, 0x00, cmd);
|
||||
}
|
||||
|
||||
void send_create_inventory_item_to_lobby(shared_ptr<Client> c, uint8_t client_id, const ItemData& item, bool exclude_c) {
|
||||
@@ -2478,9 +2487,6 @@ void send_create_inventory_item_to_lobby(shared_ptr<Client> c, uint8_t client_id
|
||||
if (!lc) {
|
||||
continue;
|
||||
}
|
||||
if (lc->version() != Version::BB_V4) {
|
||||
throw logic_error("6xBE can only be sent to BB clients");
|
||||
}
|
||||
if ((lc != c) || !exclude_c) {
|
||||
send_create_inventory_item_to_client(lc, client_id, item);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user