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>
This commit is contained in:
pierrelasse 2024-05-28 00:10:17 +02:00 committed by GitHub
parent 3e577ee31f
commit 8fef2f383c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,11 +1,11 @@
#include "view_esp.hpp" #include "view_esp.hpp"
#include "gta/enums.hpp"
#include "gta_util.hpp" #include "gta_util.hpp"
#include "pointers.hpp" #include "pointers.hpp"
#include "services/players/player_service.hpp" #include "services/players/player_service.hpp"
#include "util/math.hpp" #include "util/math.hpp"
#include "util/misc.hpp" #include "util/misc.hpp"
#include "gta/enums.hpp"
namespace big namespace big
{ {
@ -81,10 +81,11 @@ namespace big
} }
draw_list->AddText(name_pos, esp_color, name_str.c_str()); 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 = ""; std::string mode_str = "";
if (g.esp.god) if (g.esp.god)
{ {
if (ped_damage_bits & (uint32_t)eEntityProofs::GOD) if (in_god)
{ {
mode_str = "ESP_GOD"_T.data(); mode_str = "ESP_GOD"_T.data();
} }
@ -92,21 +93,23 @@ namespace big
{ {
if (ped_damage_bits & (uint32_t)eEntityProofs::BULLET) 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 (ped_damage_bits & (uint32_t)eEntityProofs::EXPLOSION)
{ {
if (!mode_str.empty())
mode_str += ", ";
mode_str += "ESP_EXPLOSION"_T.data(); mode_str += "ESP_EXPLOSION"_T.data();
} }
} }
}
if (auto player_vehicle = plyr->get_current_vehicle(); if (auto player_vehicle = plyr->get_current_vehicle(); player_vehicle && (plyr->get_ped()->m_ped_task_flag & (uint32_t)ePedTask::TASK_DRIVING)
player_vehicle && && (player_vehicle->m_damage_bits & (uint32_t)eEntityProofs::GOD))
(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 (!mode_str.empty())
mode_str += ", ";
mode_str += "VEHICLE_GOD"_T.data();
}
} }
if (!mode_str.empty()) if (!mode_str.empty())
@ -116,7 +119,7 @@ namespace big
mode_str.c_str()); mode_str.c_str());
} }
if (!(ped_damage_bits & (uint32_t)eEntityProofs::GOD)) if (!in_god)
{ {
if (g.esp.health) if (g.esp.health)
{ {