assign item IDs chen changing banks; fixes #546
This commit is contained in:
+5
-1
@@ -1480,7 +1480,11 @@ static void server_command_change_bank(shared_ptr<Client> c, const std::string&
|
|||||||
throw runtime_error("invalid bank number");
|
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());
|
send_text_message_printf(c, "%" PRIu32 " items\n%" PRIu32 " Meseta", bank.num_items.load(), bank.meseta.load());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -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")) {
|
if (c->log.info("Assigned inventory item IDs%s", consume_ids ? "" : " but did not mark IDs as used")) {
|
||||||
c->print_inventory(stderr);
|
c->print_inventory(stderr);
|
||||||
|
auto& bank = c->current_bank();
|
||||||
if (p->bank.num_items) {
|
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->log.info("Assigned bank item IDs");
|
||||||
c->print_bank(stderr);
|
c->print_bank(stderr);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user