diff --git a/desktop_version/src/UtilityClass.cpp b/desktop_version/src/UtilityClass.cpp index 7b6695ad..175cbaa5 100644 --- a/desktop_version/src/UtilityClass.cpp +++ b/desktop_version/src/UtilityClass.cpp @@ -99,11 +99,11 @@ std::string UtilityClass::String( int _v ) return(os.str()); } -int UtilityClass::Int(const char* str) +int UtilityClass::Int(const char* str, int fallback /*= 0*/) { if (!is_number(str)) { - return 0; + return fallback; } return SDL_atoi(str); diff --git a/desktop_version/src/UtilityClass.h b/desktop_version/src/UtilityClass.h index d5eed8d6..8fbd7413 100644 --- a/desktop_version/src/UtilityClass.h +++ b/desktop_version/src/UtilityClass.h @@ -37,7 +37,7 @@ public: static std::string String(int _v); - static int Int(const char* str); + static int Int(const char* str, int fallback = 0); static std::string GCString(std::vector buttons);