fix stacked item bank deposit bug
This commit is contained in:
@@ -1472,7 +1472,7 @@ static void on_ep3_private_word_select_bb_bank_action(shared_ptr<Client> c, uint
|
||||
} else { // Deposit item
|
||||
auto item = p->remove_item(cmd.item_id, cmd.item_amount, c->version() != Version::BB_V4);
|
||||
bank.add_item(item);
|
||||
send_destroy_item(c, cmd.item_id, cmd.item_amount);
|
||||
send_destroy_item(c, cmd.item_id, cmd.item_amount, true);
|
||||
|
||||
string name = s->item_name_index->describe_item(Version::BB_V4, item);
|
||||
l->log.info("Player %hu deposited item %08" PRIX32 " (x%hhu) (%s) in the bank",
|
||||
|
||||
+6
-2
@@ -2331,11 +2331,15 @@ void send_create_inventory_item(shared_ptr<Client> c, const ItemData& item) {
|
||||
send_command_t(l, 0x60, 0x00, cmd);
|
||||
}
|
||||
|
||||
void send_destroy_item(shared_ptr<Client> c, uint32_t item_id, uint32_t amount) {
|
||||
void send_destroy_item(shared_ptr<Client> c, uint32_t item_id, uint32_t amount, bool exclude_c) {
|
||||
auto l = c->require_lobby();
|
||||
uint16_t client_id = c->lobby_client_id;
|
||||
G_DeleteInventoryItem_6x29 cmd = {{0x29, 0x03, client_id}, item_id, amount};
|
||||
send_command_t(l, 0x60, 0x00, cmd);
|
||||
if (exclude_c) {
|
||||
send_command_excluding_client(l, c, 0x60, 0x00, &cmd, sizeof(cmd));
|
||||
} else {
|
||||
send_command_t(l, 0x60, 0x00, cmd);
|
||||
}
|
||||
}
|
||||
|
||||
void send_item_identify_result(shared_ptr<Client> c) {
|
||||
|
||||
+1
-1
@@ -308,7 +308,7 @@ void send_drop_stacked_item(std::shared_ptr<ServerState> s, Channel& ch, const I
|
||||
void send_drop_stacked_item(std::shared_ptr<Lobby> l, const ItemData& item, uint8_t floor, float x, float z);
|
||||
void send_pick_up_item(std::shared_ptr<Client> c, uint32_t id, uint8_t floor);
|
||||
void send_create_inventory_item(std::shared_ptr<Client> c, const ItemData& item);
|
||||
void send_destroy_item(std::shared_ptr<Client> c, uint32_t item_id, uint32_t amount);
|
||||
void send_destroy_item(std::shared_ptr<Client> c, uint32_t item_id, uint32_t amount, bool exclude_c = false);
|
||||
void send_item_identify_result(std::shared_ptr<Client> c);
|
||||
void send_bank(std::shared_ptr<Client> c);
|
||||
void send_shop(std::shared_ptr<Client> c, uint8_t shop_type);
|
||||
|
||||
Reference in New Issue
Block a user