summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVittorio Romeo <vittorio.romeo@outlook.com>2021-10-27 23:08:04 +0100
committerVittorio Romeo <vittorio.romeo@outlook.com>2021-10-27 23:08:04 +0100
commit71f57c6f317fa118ac3f2bd231003743cb0e86cf (patch)
treefe0066403621f5ae78f08c90c9fa9f59a6a665c8
parent0f12fe80afc98a53015717c8f207820fa9a22beb (diff)
Refactoring
-rw-r--r--src/SSVOpenHexagon/Core/Steam.cpp27
1 files changed, 10 insertions, 17 deletions
diff --git a/src/SSVOpenHexagon/Core/Steam.cpp b/src/SSVOpenHexagon/Core/Steam.cpp
index 2d77f9fb..c3808e3b 100644
--- a/src/SSVOpenHexagon/Core/Steam.cpp
+++ b/src/SSVOpenHexagon/Core/Steam.cpp
@@ -629,25 +629,18 @@ bool steam_manager::steam_manager_impl::update_hardcoded_achievements()
{
bool any_failure = false;
- if(!update_hardcoded_achievement_cube_master())
+ const auto check_failure = [&](const bool x)
{
- any_failure = true;
- }
-
- if(!update_hardcoded_achievement_hypercube_master())
- {
- any_failure = true;
- }
-
- if(!update_hardcoded_achievement_cube_god())
- {
- any_failure = true;
- }
+ if(!x)
+ {
+ any_failure = true;
+ }
+ };
- if(!update_hardcoded_achievement_hypercube_god())
- {
- any_failure = true;
- }
+ check_failure(update_hardcoded_achievement_cube_master());
+ check_failure(update_hardcoded_achievement_hypercube_master());
+ check_failure(update_hardcoded_achievement_cube_god());
+ check_failure(update_hardcoded_achievement_hypercube_god());
return !any_failure;
}