make it possible to disable item tracking

This commit is contained in:
Martin Michelsen
2022-06-24 22:00:47 -07:00
parent c2b112db43
commit fc078a5d51
10 changed files with 168 additions and 85 deletions
+3 -2
View File
@@ -96,8 +96,9 @@ void Lobby::add_client(shared_ptr<Client> c) {
}
}
// If the lobby is a game, assign the inventory's item IDs
if (this->is_game()) {
// If the lobby is a game and item tracking is enabled, assign the inventory's
// item IDs
if (this->is_game() && (this->flags & Lobby::Flag::ITEM_TRACKING_ENABLED)) {
auto& inv = c->game_data.player()->inventory;
size_t count = min<uint8_t>(inv.num_items, 30);
for (size_t x = 0; x < count; x++) {