HUGO: Fix wrong check for error in save/load

On succesful save saveGame returns true, not zero.
This caused the autosave to erroneusly report save failures repeatedly
This commit is contained in:
Walter Agazzi 2023-02-02 14:58:36 +01:00
parent c4629edd5d
commit 02164ebd54

View File

@ -165,11 +165,11 @@ void HugoEngine::setMaxScore(const int newScore) {
}
Common::Error HugoEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
return (_file->saveGame(slot, desc) ? Common::kWritingFailed : Common::kNoError);
return (_file->saveGame(slot, desc) ? Common::kNoError : Common::kWritingFailed);
}
Common::Error HugoEngine::loadGameState(int slot) {
return (_file->restoreGame(slot) ? Common::kReadingFailed : Common::kNoError);
return (_file->restoreGame(slot) ? Common::kNoError : Common::kReadingFailed);
}
bool HugoEngine::hasFeature(EngineFeature f) const {