diff --git a/CHANGELOG.md b/CHANGELOG.md index 811f32d..6ea1f13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [1.6.2] - 2024-02-09 + +### Fixed + +- Crash when leaving LevelInfoLayer + ## [1.6.1-beta.3] - 2024-02-07 ### Changed diff --git a/mod.json b/mod.json index 21e0b2b..09425c9 100644 --- a/mod.json +++ b/mod.json @@ -4,7 +4,7 @@ "win": "2.204", "android": "2.205" }, - "version": "v1.6.1-beta.3", + "version": "v1.6.2", "id": "spaghettdev.gd-roulette", "name": "GD-Roulette", "developer": "SpaghettDev", diff --git a/src/layers/LevelInfoLayer.cpp b/src/layers/LevelInfoLayer.cpp index 1e23db9..82cab94 100644 --- a/src/layers/LevelInfoLayer.cpp +++ b/src/layers/LevelInfoLayer.cpp @@ -49,18 +49,18 @@ class $modify(LevelInfoLayer) void onBack(CCObject* sender) { - if (levelIDs.size() != 1) - levelIDs.pop_back(); - - if (g_rouletteManager.isPlayingRoulette && g_rouletteManager.rouletteLayer && levelIDs.back() == g_rouletteManager.currentLevelID) + if (g_rouletteManager.isPlayingRoulette) { - as( - g_rouletteManager.rouletteLayer->m_pPlayingMenu->getChildByTag(20) - )->setString(fmt::format("{}%", g_rouletteManager.levelPercentageGoal).c_str()); - } + if (levelIDs.size() != 0) + levelIDs.pop_back(); - if (levelIDs.size() == 1) - levelIDs.pop_back(); + if (g_rouletteManager.rouletteLayer && levelIDs.back() == g_rouletteManager.currentLevelID) + { + as( + g_rouletteManager.rouletteLayer->m_pPlayingMenu->getChildByTag(20) + )->setString(fmt::format("{}%", g_rouletteManager.levelPercentageGoal).c_str()); + } + } LevelInfoLayer::onBack(sender); }