From 8fef2f383c2596f521f5d17d512f08cd9a344b97 Mon Sep 17 00:00:00 2001 From: pierrelasse <76223390+pierrelasse@users.noreply.github.com> Date: Tue, 28 May 2024 00:10:17 +0200 Subject: [PATCH] Fix GodMode not being displayed when Vehicle-GodMode (#3123) Co-authored-by: R.K. <13259220+rkwapisz@users.noreply.github.com> Co-authored-by: dynamoNg <139460769+lonelybud@users.noreply.github.com> --- src/views/esp/view_esp.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/views/esp/view_esp.cpp b/src/views/esp/view_esp.cpp index 22cc6af8..2c8a3c6b 100644 --- a/src/views/esp/view_esp.cpp +++ b/src/views/esp/view_esp.cpp @@ -1,11 +1,11 @@ #include "view_esp.hpp" +#include "gta/enums.hpp" #include "gta_util.hpp" #include "pointers.hpp" #include "services/players/player_service.hpp" #include "util/math.hpp" #include "util/misc.hpp" -#include "gta/enums.hpp" namespace big { @@ -81,10 +81,11 @@ namespace big } draw_list->AddText(name_pos, esp_color, name_str.c_str()); + const bool in_god = ped_damage_bits & (uint32_t)eEntityProofs::GOD; std::string mode_str = ""; if (g.esp.god) { - if (ped_damage_bits & (uint32_t)eEntityProofs::GOD) + if (in_god) { mode_str = "ESP_GOD"_T.data(); } @@ -92,21 +93,23 @@ namespace big { if (ped_damage_bits & (uint32_t)eEntityProofs::BULLET) { - mode_str += "ESP_BULLET"_T.data(); + mode_str = "ESP_BULLET"_T.data(); } if (ped_damage_bits & (uint32_t)eEntityProofs::EXPLOSION) { + if (!mode_str.empty()) + mode_str += ", "; mode_str += "ESP_EXPLOSION"_T.data(); } } - } - if (auto player_vehicle = plyr->get_current_vehicle(); - player_vehicle && - (plyr->get_ped()->m_ped_task_flag & (uint32_t)ePedTask::TASK_DRIVING) && - (player_vehicle->m_damage_bits & (uint32_t)eEntityProofs::GOD)) - { - mode_str =+ "VEHICLE_GOD"_T.data(); + if (auto player_vehicle = plyr->get_current_vehicle(); player_vehicle && (plyr->get_ped()->m_ped_task_flag & (uint32_t)ePedTask::TASK_DRIVING) + && (player_vehicle->m_damage_bits & (uint32_t)eEntityProofs::GOD)) + { + if (!mode_str.empty()) + mode_str += ", "; + mode_str += "VEHICLE_GOD"_T.data(); + } } if (!mode_str.empty()) @@ -116,7 +119,7 @@ namespace big mode_str.c_str()); } - if (!(ped_damage_bits & (uint32_t)eEntityProofs::GOD)) + if (!in_god) { if (g.esp.health) {