assign item IDs chen changing banks; fixes #546

This commit is contained in:
Martin Michelsen
2024-08-02 17:54:14 -07:00
parent 3a74dbf04e
commit d11329b2c9
2 changed files with 7 additions and 2 deletions
+5 -1
View File
@@ -1480,7 +1480,11 @@ static void server_command_change_bank(shared_ptr<Client> c, const std::string&
throw runtime_error("invalid bank number");
}
const auto& bank = c->current_bank();
auto& bank = c->current_bank();
bank.assign_ids(0x99000000 + (c->lobby_client_id << 20));
c->log.info("Assigned bank item IDs");
c->print_bank(stderr);
send_text_message_printf(c, "%" PRIu32 " items\n%" PRIu32 " Meseta", bank.num_items.load(), bank.meseta.load());
}
+2 -1
View File
@@ -918,8 +918,9 @@ void Lobby::assign_inventory_and_bank_item_ids(shared_ptr<Client> c, bool consum
if (c->log.info("Assigned inventory item IDs%s", consume_ids ? "" : " but did not mark IDs as used")) {
c->print_inventory(stderr);
auto& bank = c->current_bank();
if (p->bank.num_items) {
p->bank.assign_ids(0x99000000 + (c->lobby_client_id << 20));
bank.assign_ids(0x99000000 + (c->lobby_client_id << 20));
c->log.info("Assigned bank item IDs");
c->print_bank(stderr);
} else {