From af1b61ff5c54afbbb3634dc335e65b0b8c5d3b11 Mon Sep 17 00:00:00 2001 From: HarrySilan Date: Wed, 22 Jun 2022 17:58:16 +0800 Subject: [PATCH] fix Custom Teleport uncheck All --- cheat-library/src/user/cheat/teleport/CustomTeleports.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cheat-library/src/user/cheat/teleport/CustomTeleports.cpp b/cheat-library/src/user/cheat/teleport/CustomTeleports.cpp index 76e35fa..b99dd18 100644 --- a/cheat-library/src/user/cheat/teleport/CustomTeleports.cpp +++ b/cheat-library/src/user/cheat/teleport/CustomTeleports.cpp @@ -52,6 +52,7 @@ namespace cheat::feature return; selectedIndex = -1; + UpdateIndexName(); teleports.push_back({ teleportName, pos }); auto dir = std::filesystem::current_path(); @@ -69,6 +70,8 @@ namespace cheat::feature if (ImGui::Button("Reload")) { selectedIndex = -1; + UpdateIndexName(); + checkedIndices.clear(); auto dir = std::filesystem::current_path(); dir /= "teleports"; auto result = std::filesystem::directory_iterator(dir); @@ -102,6 +105,7 @@ namespace cheat::feature if (ImGui::Button("Load from JSON")) { selectedIndex = -1; + UpdateIndexName(); auto dir = std::filesystem::current_path(); dir /= "teleports"; LOG_INFO("Defined dir"); @@ -182,7 +186,9 @@ namespace cheat::feature if (allChecked) { selectedIndex = -1; if (!searchIndices.empty()) { - checkedIndices.erase(searchIndices.begin(), searchIndices.end()); + for (const auto& i : searchIndices) { + checkedIndices.erase(i); + } } else { checkedIndices.clear();