diff --git a/src/hooks/protections/received_event.cpp b/src/hooks/protections/received_event.cpp index aab0f576..131d0e25 100644 --- a/src/hooks/protections/received_event.cpp +++ b/src/hooks/protections/received_event.cpp @@ -25,7 +25,8 @@ namespace big id.m_instance_id = buffer.Read(8); } - void scan_weapon_damage_event(CNetGamePlayer* player, rage::datBitBuffer* buffer) + // Returns true if bad event + bool scan_weapon_damage_event(rage::netEventMgr* event_manager, CNetGamePlayer* player, CNetGamePlayer* target_player, int event_index, int event_handled_bitset, rage::datBitBuffer* buffer) { uint8_t damageType; uint32_t weaponType; // weaponHash @@ -71,6 +72,13 @@ namespace big damageType = buffer->Read(2); weaponType = buffer->Read(32); + const auto is_crash_weapon = weaponType == RAGE_JOAAT("AMMO_BALL"); + if (is_crash_weapon) + { + g_pointers->m_gta.m_send_event_ack(event_manager, player, target_player, event_index, event_handled_bitset); + return true; + } + overrideDefaultDamage = buffer->Read(1); hitEntityWeapon = buffer->Read(1); hitWeaponAmmoAttachment = buffer->Read(1); @@ -214,6 +222,8 @@ namespace big player->get_ped()->m_navigation->get_position()); }); } + + return false; } void scan_explosion_event(CNetGamePlayer* player, rage::datBitBuffer* buffer) @@ -705,7 +715,10 @@ namespace big } case eNetworkEvents::WEAPON_DAMAGE_EVENT: { - scan_weapon_damage_event(source_player, buffer); + if (scan_weapon_damage_event(event_manager, source_player, target_player, event_index, event_handled_bitset, buffer)) + { + return; + } break; } default: break;