aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/savestate.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/engines/savestate.cpp b/engines/savestate.cpp
index 32aa39c118..3cd81a2ff6 100644
--- a/engines/savestate.cpp
+++ b/engines/savestate.cpp
@@ -35,15 +35,10 @@ void SaveStateDescriptor::setThumbnail(Graphics::Surface *t) {
bool SaveStateDescriptor::getBool(const Common::String &key) const {
if (contains(key)) {
- Common::String value = getVal(key);
- if (value.equalsIgnoreCase("true") ||
- value.equalsIgnoreCase("yes") ||
- value.equals("1"))
- return true;
- if (value.equalsIgnoreCase("false") ||
- value.equalsIgnoreCase("no") ||
- value.equals("0"))
- return false;
+ const Common::String value = getVal(key);
+ bool valueAsBool;
+ if (Common::parseBool(value, valueAsBool))
+ return valueAsBool;
error("SaveStateDescriptor: %s '%s' has unknown value '%s' for boolean '%s'",
save_slot().c_str(), description().c_str(), value.c_str(), key.c_str());
}