summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVittorio Romeo <vittorio.romeo@outlook.com>2021-10-31 17:59:37 +0000
committerVittorio Romeo <vittorio.romeo@outlook.com>2021-10-31 17:59:37 +0000
commita5ea27173080d6f14c1144224ad4bae0b24601cd (patch)
tree6f1fd3d24a2741ccb160db6f0d53cf745aae0c8d
parentee7d06426813c510e8a06412a38fdcd316c2448b (diff)
Code refactoring
-rw-r--r--src/SSVOpenHexagon/Core/Steam.cpp28
1 files changed, 8 insertions, 20 deletions
diff --git a/src/SSVOpenHexagon/Core/Steam.cpp b/src/SSVOpenHexagon/Core/Steam.cpp
index 2d77f9fb..2ceb4fa2 100644
--- a/src/SSVOpenHexagon/Core/Steam.cpp
+++ b/src/SSVOpenHexagon/Core/Steam.cpp
@@ -627,29 +627,17 @@ bool steam_manager::steam_manager_impl::
bool steam_manager::steam_manager_impl::update_hardcoded_achievements()
{
- bool any_failure = false;
+ // Intentionally not short-circuiting via boolean operators here.
- if(!update_hardcoded_achievement_cube_master())
- {
- any_failure = true;
- }
-
- if(!update_hardcoded_achievement_hypercube_master())
- {
- any_failure = true;
- }
+ int failures = 0;
- if(!update_hardcoded_achievement_cube_god())
- {
- any_failure = true;
- }
-
- if(!update_hardcoded_achievement_hypercube_god())
- {
- any_failure = true;
- }
+ failures +=
+ static_cast<int>(!update_hardcoded_achievement_cube_master()) +
+ static_cast<int>(!update_hardcoded_achievement_hypercube_master()) +
+ static_cast<int>(!update_hardcoded_achievement_cube_god()) +
+ static_cast<int>(!update_hardcoded_achievement_hypercube_god());
- return !any_failure;
+ return failures == 0;
}
void steam_manager::steam_manager_impl::for_workshop_pack_folders(