From a02d776b0048c429de360853245bf12637a366fb Mon Sep 17 00:00:00 2001 From: Info Teddy Date: Thu, 23 Jan 2020 06:50:09 -0800 Subject: [PATCH] Make foundtrinket() be accurate in custommode Previously, if it was called in a custom level, it would say "out of Twenty" no matter what, even if the level had zero trinkets. This commit fixes that. --- desktop_version/src/Script.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index d8fd51ff..f606752b 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -1892,7 +1892,16 @@ void scriptclass::run( KeyPoll& key, Graphics& dwgfx, Game& game, mapclass& map, dwgfx.addline("You have found a shiny trinket!"); dwgfx.textboxcenterx(); - dwgfx.createtextbox(" " + help.number(game.trinkets) + " out of Twenty ", 50, 135, 174, 174, 174); + std::string usethisnum; + if (map.custommode) + { + usethisnum = help.number(map.customtrinkets); + } + else + { + usethisnum = "Twenty"; + } + dwgfx.createtextbox(" " + help.number(game.trinkets) + " out of " + usethisnum + " ", 50, 135, 174, 174, 174); dwgfx.textboxcenterx(); if (!game.backgroundtext)