Inv deSerialize(): Prevent infinite loop, error on failure (#7711)
Throws an error about potentially damaged player inventories but proceeds converting the rest of them
This commit is contained in:
@@ -139,7 +139,12 @@ void RemotePlayer::deSerialize(std::istream &is, const std::string &playername,
|
||||
} catch (SettingNotFoundException &e) {}
|
||||
}
|
||||
|
||||
inventory.deSerialize(is);
|
||||
try {
|
||||
inventory.deSerialize(is);
|
||||
} catch (SerializationError &e) {
|
||||
errorstream << "Failed to deserialize player inventory. player_name="
|
||||
<< name << " " << e.what() << std::endl;
|
||||
}
|
||||
|
||||
if (!inventory.getList("craftpreview") && inventory.getList("craftresult")) {
|
||||
// Convert players without craftpreview
|
||||
|
||||
Reference in New Issue
Block a user