mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
feat: auto patch invalid inventory id pre 0.25
This commit is contained in:
parent
371fdaedce
commit
e70d30b9a2
2 changed files with 7 additions and 4 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue