From 8cc234700686ebfc1fd6436bceb07943dce66f33 Mon Sep 17 00:00:00 2001 From: Callow <37184274+CallowBlack@users.noreply.github.com> Date: Sun, 12 Jun 2022 15:50:43 +0300 Subject: [PATCH] pr #42: little refactor --- cheat-library/src/user/cheat/esp/ESPRender.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/cheat-library/src/user/cheat/esp/ESPRender.cpp b/cheat-library/src/user/cheat/esp/ESPRender.cpp index e35314d..32a1342 100644 --- a/cheat-library/src/user/cheat/esp/ESPRender.cpp +++ b/cheat-library/src/user/cheat/esp/ESPRender.cpp @@ -388,13 +388,19 @@ namespace cheat::feature::esp::render return; auto draw = ImGui::GetBackgroundDrawList(); - ImRect screen_rect = { 0.0f, 0.0f, ImGui::GetIO().DisplaySize.x, ImGui::GetIO().DisplaySize.y }; - auto screen_center = screen_rect.GetCenter(); + auto& esp = ESP::GetInstance(); - if (!esp.f_MiddleScreenTracer) - draw->AddLine(s_AvatarPosition, *screenPos, color); - else + if (esp.f_MiddleScreenTracer) + { + ImRect screen_rect = { 0.0f, 0.0f, ImGui::GetIO().DisplaySize.x, ImGui::GetIO().DisplaySize.y }; + auto screen_center = screen_rect.GetCenter(); draw->AddLine(screen_center, *screenPos, color); + } + else + { + draw->AddLine(s_AvatarPosition, *screenPos, color); + } + } #define PI 3.14159265358979323846