From 9bc99e18cc859d54a9c2bfd388e8a8e63e09412d Mon Sep 17 00:00:00 2001 From: Andreas Maerten <24669514+Yimura@users.noreply.github.com> Date: Sun, 23 Apr 2023 22:39:16 +0200 Subject: [PATCH] chore: disabled blame explosion infraction (#1282) --- src/hooks/protections/received_event.cpp | 49 ++++++++++++------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/src/hooks/protections/received_event.cpp b/src/hooks/protections/received_event.cpp index edc1b195..8188ca78 100644 --- a/src/hooks/protections/received_event.cpp +++ b/src/hooks/protections/received_event.cpp @@ -27,7 +27,7 @@ namespace big void scan_weapon_damage_event(CNetGamePlayer* player, rage::datBitBuffer* buffer) { uint8_t damageType; - uint32_t weaponType;// weaponHash + uint32_t weaponType; // weaponHash bool overrideDefaultDamage; bool hitEntityWeapon; @@ -55,8 +55,8 @@ namespace big uint16_t f112_1; - uint16_t parentGlobalId;// Source entity? - uint16_t hitGlobalId; // Target entity? + uint16_t parentGlobalId; // Source entity? + uint16_t hitGlobalId; // Target entity? uint8_t tyreIndex; uint8_t suspensionIndex; @@ -107,7 +107,7 @@ namespace big if (isNetTargetPos) { - localPos.x = buffer->ReadSignedFloat(16, 55.f);// divisor: 0x425C0000 + localPos.x = buffer->ReadSignedFloat(16, 55.f); // divisor: 0x425C0000 localPos.y = buffer->ReadSignedFloat(16, 55.f); localPos.z = buffer->ReadSignedFloat(16, 55.f); } @@ -139,13 +139,13 @@ namespace big } else { - parentGlobalId = buffer->Read(13);// +118 - hitGlobalId = buffer->Read(13);// +120 + parentGlobalId = buffer->Read(13); // +118 + hitGlobalId = buffer->Read(13); // +120 } if (damageType < 2) { - localPos.x = buffer->ReadSignedFloat(16, 55.f);// divisor: 0x425C0000 + localPos.x = buffer->ReadSignedFloat(16, 55.f); // divisor: 0x425C0000 localPos.y = buffer->ReadSignedFloat(16, 55.f); localPos.z = buffer->ReadSignedFloat(16, 55.f); @@ -155,14 +155,14 @@ namespace big if (hasVehicleData) { - tyreIndex = buffer->Read(4);// +122 - suspensionIndex = buffer->Read(4);// +123 + tyreIndex = buffer->Read(4); // +122 + suspensionIndex = buffer->Read(4); // +123 } } } else { - hitComponent = buffer->Read(5);// +108 + hitComponent = buffer->Read(5); // +108 } f133 = buffer->Read(1); @@ -170,7 +170,7 @@ namespace big if (hasImpactDir) { - impactDir.x = buffer->ReadSignedFloat(16, 6.2831854820251f);// divisor: 0x40C90FDB + impactDir.x = buffer->ReadSignedFloat(16, 6.2831854820251f); // divisor: 0x40C90FDB impactDir.y = buffer->ReadSignedFloat(16, 6.2831854820251f); impactDir.z = buffer->ReadSignedFloat(16, 6.2831854820251f); } @@ -334,7 +334,8 @@ namespace big std::vformat("BLAMED_FOR_EXPLOSION"_T, std::make_format_args(player->get_name(), reinterpret_cast(entity)->m_player_info->m_net_player_data.m_name))); - session::add_infraction(g_player_service->get_by_id(player->m_player_id), Infraction::BLAME_EXPLOSION_DETECTED); + // too many false positives, disabling it + //session::add_infraction(g_player_service->get_by_id(player->m_player_id), Infraction::BLAME_EXPLOSION_DETECTED); return; } @@ -511,19 +512,19 @@ namespace big if (type == WorldStateDataType::Rope) { - buffer->Read(9); // network rope id - buffer->Read(19);// pos x - buffer->Read(19);// pos y - buffer->Read(19);// pos z - buffer->Read(19);// rot x - buffer->Read(19);// rot y - buffer->Read(19);// rot z - buffer->Read(16);// length + buffer->Read(9); // network rope id + buffer->Read(19); // pos x + buffer->Read(19); // pos y + buffer->Read(19); // pos z + buffer->Read(19); // rot x + buffer->Read(19); // rot y + buffer->Read(19); // rot z + buffer->Read(16); // length int type = buffer->Read(4); float initial_length = buffer->Read(16); float min_length = buffer->Read(16); - if (type == 0 || initial_length < min_length)// https://docs.fivem.net/natives/?_0xE832D760399EB220 + if (type == 0 || initial_length < min_length) // https://docs.fivem.net/natives/?_0xE832D760399EB220 { // most definitely a crash LOG(INFO) << std::hex << std::uppercase << "0x" << id.m_hash; @@ -534,9 +535,9 @@ namespace big } else if (type == WorldStateDataType::PopGroupOverride) { - int pop_schedule = buffer->ReadSigned(8);// Pop Schedule - int pop_group = buffer->Read(32); // Pop Group - int percentage = buffer->Read(7); // Percentage + int pop_schedule = buffer->ReadSigned(8); // Pop Schedule + int pop_group = buffer->Read(32); // Pop Group + int percentage = buffer->Read(7); // Percentage if (pop_group == 0 && (percentage == 0 || percentage == 103)) {