feat: auto patch invalid inventory id pre 0.25

This commit is contained in:
MihailRis
2024-11-19 12:18:59 +03:00
parent 371fdaedce
commit e70d30b9a2
2 changed files with 7 additions and 4 deletions
+5
View File
@@ -148,6 +148,11 @@ std::unique_ptr<Level> World::load(
0
);
player->deserialize(playerMap);
auto& inventory = player->getInventory();
// invalid inventory id pre 0.25
if (inventory->getId() == 0) {
inventory->setId(level->getWorld()->getNextInventoryId());
}
level->inventories->store(player->getInventory());
}
} else {