contentpack removal feature + refactor

This commit is contained in:
MihailRis
2024-03-11 13:21:06 +03:00
parent 3f0c710a47
commit daaba374a3
24 changed files with 345 additions and 295 deletions
+15 -3
View File
@@ -236,8 +236,20 @@ void Player::deserialize(dynamic::Map *src) {
void Player::convert(dynamic::Map* data, const ContentLUT* lut) {
auto inventory = data->map("inventory");
if (inventory) {
Inventory::convert(inventory, lut);
auto players = data->list("players");
if (players) {
for (uint i = 0; i < players->size(); i++) {
auto playerData = players->map(i);
auto inventory = playerData->map("inventory");
if (inventory) {
Inventory::convert(inventory, lut);
}
}
} else {
auto inventory = data->map("inventory");
if (inventory) {
Inventory::convert(inventory, lut);
}
}
}