From 97deda2675748d4670c29d37a6ab00e43de5fc78 Mon Sep 17 00:00:00 2001 From: Misa Date: Thu, 29 Dec 2022 14:25:27 -0800 Subject: [PATCH] Add debug print to unlockAchievement This print is useful to know if an achievement (one that's not already unlocked) would actually be unlocked in an end user environment, while running the game in a dev environment. Also fixed up the style of the function because it was definitely inconsistent with the surrounding code. --- desktop_version/src/Game.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index b0043bb5..84ba2851 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -6940,9 +6940,16 @@ void Game::returntoingame(void) DEFER_CALLBACK(nextbgcolor); } -void Game::unlockAchievement(const char *name) { -#if !defined(MAKEANDPLAY) - if (!map.custommode) NETWORK_unlockAchievement(name); +void Game::unlockAchievement(const char* name) +{ +#ifndef MAKEANDPLAY + if (map.custommode) + { + return; + } + + vlog_debug("Achievement \"%s\" unlocked.", name); + NETWORK_unlockAchievement(name); #endif }