From 76e3b3ede45394c48526d8c797998b3b2a39332b Mon Sep 17 00:00:00 2001 From: Misa Date: Tue, 14 Apr 2020 19:39:08 -0700 Subject: [PATCH] Remove map.numshinytrinkets This removes map.numshinytrinkets in favor of using map.shinytrinkets.size(). Having automatic length tracking is much less error-prone and less tedious. --- desktop_version/src/Map.cpp | 1 - desktop_version/src/Map.h | 1 - desktop_version/src/Render.cpp | 4 ++-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/desktop_version/src/Map.cpp b/desktop_version/src/Map.cpp index 18cc6c0c..b4534272 100644 --- a/desktop_version/src/Map.cpp +++ b/desktop_version/src/Map.cpp @@ -430,7 +430,6 @@ void mapclass::initmapdata() setteleporter(18, 1); setteleporter(18, 7); - numshinytrinkets = 18; settrinket(14, 4); settrinket(13, 6); settrinket(11, 12); diff --git a/desktop_version/src/Map.h b/desktop_version/src/Map.h index d522eeeb..ed41a7a1 100644 --- a/desktop_version/src/Map.h +++ b/desktop_version/src/Map.h @@ -154,7 +154,6 @@ public: std::vector teleporters; std::vector shinytrinkets; - int numshinytrinkets; bool showteleporters, showtargets, showtrinkets; //Roomtext diff --git a/desktop_version/src/Render.cpp b/desktop_version/src/Render.cpp index 6b3b56ec..83d2dc26 100644 --- a/desktop_version/src/Render.cpp +++ b/desktop_version/src/Render.cpp @@ -2026,7 +2026,7 @@ void maprender() if (map.showtrinkets) { - for (int i = 0; i < map.numshinytrinkets; i++) + for (size_t i = 0; i < map.shinytrinkets.size(); i++) { if (!obj.collect[i]) { @@ -2837,7 +2837,7 @@ void teleporterrender() if (map.showtrinkets) { - for (int i = 0; i < map.numshinytrinkets; i++) + for (size_t i = 0; i < map.shinytrinkets.size(); i++) { if (!obj.collect[i]) {