fix bug that caused sorting inventory to delete extended tech levels

This commit is contained in:
Martin Michelsen
2023-11-15 11:34:53 -08:00
parent 0705b4d155
commit 687a4515a2
+6
View File
@@ -1428,6 +1428,12 @@ static void on_sort_inventory_bb(shared_ptr<Client> c, uint8_t, uint8_t, const v
sorted[x] = p->inventory.items[index];
}
}
// It's annoying that extension data is stored in the inventory items array,
// because we have to be careful to avoid sorting it here too.
for (size_t x = 0; x < 30; x++) {
sorted[x].extension_data1 = p->inventory.items[x].extension_data1;
sorted[x].extension_data2 = p->inventory.items[x].extension_data2;
}
p->inventory.items = sorted;
}
}