fix various battle mode behaviors

This commit is contained in:
Martin Michelsen
2023-11-13 15:42:17 -08:00
parent c5f047dc0d
commit 08fbbd50ad
6 changed files with 47 additions and 31 deletions
+9
View File
@@ -372,6 +372,15 @@ void Lobby::on_item_id_generated_externally(uint32_t item_id) {
}
}
void Lobby::assign_inventory_item_ids(shared_ptr<Client> c) {
auto p = c->game_data.character();
for (size_t z = 0; z < p->inventory.num_items; z++) {
p->inventory.items[z].data.id = this->generate_item_id(c->lobby_client_id);
}
c->log.info("Assigned item IDs");
p->print_inventory(stderr, c->version(), c->require_server_state()->item_name_index);
}
unordered_map<uint32_t, shared_ptr<Client>> Lobby::clients_by_serial_number() const {
unordered_map<uint32_t, shared_ptr<Client>> ret;
for (auto c : this->clients) {