- const int bits = ReadInt24_t();
- FOREACH(Items, bits & BIT(it.m_id), {
- .int fld = inv_items[it.m_id];
- int prev = this.(fld);
- int next = this.(fld) = ReadByte();
- LOG_TRACEF("%s: %.0f -> %.0f", it.m_name, prev, next);
- });
+ g_inventory = this;
+ const int majorBits = ReadByte();
+ for (int i = 0; i < Inventory_groups_major; ++i) {
+ if (!(majorBits & BIT(i))) {
+ continue;
+ }
+ const int minorBits = ReadByte();
+ for (int j = 0; j < Inventory_groups_minor; ++j) {
+ if (!(minorBits & BIT(j))) {
+ continue;
+ }
+ const GameItem it = Items_from(Inventory_groups_minor * i + j);
+ .int fld = inv_items[it.m_id];
+ int prev = this.(fld);
+ int next = this.(fld) = ReadByte();
+ LOG_TRACEF("%s: %.0f -> %.0f", it.m_name, prev, next);
+ }
+ }