Fix saveload format negotiation
This commit is contained in:
@@ -2514,11 +2514,10 @@ std::optional<SavePreset> FindCompatibleSavePreset(const std::string &server_for
|
||||
*/
|
||||
uint8 GetAvailableLoadFormats()
|
||||
{
|
||||
return 3;
|
||||
uint8 res = 0;
|
||||
for(auto &slf : _saveload_formats) {
|
||||
if (slf.init_load != nullptr) {
|
||||
res &= (1 << slf.id);
|
||||
res |= (1 << slf.id);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
@@ -2859,6 +2858,8 @@ static SaveOrLoadResult DoLoad(LoadFilter *reader, bool load_check)
|
||||
SlError(STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR, err_str);
|
||||
}
|
||||
|
||||
DEBUG(sl, 2, "Using saveload format '%s'", fmt->name);
|
||||
|
||||
_sl.lf = fmt->init_load(_sl.lf);
|
||||
_sl.reader = new ReadBuffer(_sl.lf);
|
||||
_next_offs = 0;
|
||||
|
||||
Reference in New Issue
Block a user