Its a damage event.

This commit is contained in:
ASillyNeko 2026-08-15 15:43:31 -07:00
parent fcab344b74
commit 1d2b3332ca
No known key found for this signature in database

View file

@ -18,13 +18,13 @@ static bool __fastcall h_pOnWeaponAttack(CWeaponX* weapon, int a2)
return o_pOnWeaponAttack(weapon, a2);
}
static int(__fastcall* o_pOnAttackEvent)(int a1, Vector3* pos, int a3, float a4) = nullptr;
static int __fastcall h_pOnAttackEvent(int a1, Vector3* pos, int a3, float a4)
static int(__fastcall* o_pOnDamageEvent)(int a1, Vector3* pos, int a3, float a4) = nullptr;
static int __fastcall h_pOnDamageEvent(int a1, Vector3* pos, int a3, float a4)
{
if (pos == NULL)
return -1;
return o_pOnAttackEvent(a1, pos, a3, a4);
return o_pOnDamageEvent(a1, pos, a3, a4);
}
ON_DLL_LOAD("server.dll", R2GameServer, (CModule module))
@ -37,8 +37,8 @@ ON_DLL_LOAD("server.dll", R2GameServer, (CModule module))
o_pOnWeaponAttack = module.Offset(0x6A0220).RCast<decltype(o_pOnWeaponAttack)>();
HookAttach(&(PVOID&)o_pOnWeaponAttack, (PVOID)h_pOnWeaponAttack);
o_pOnAttackEvent = module.Offset(0x2111f0).RCast<decltype(o_pOnAttackEvent)>();
HookAttach(&(PVOID&)o_pOnAttackEvent, (PVOID)h_pOnAttackEvent);
o_pOnDamageEvent = module.Offset(0x2111f0).RCast<decltype(o_pOnDamageEvent)>();
HookAttach(&(PVOID&)o_pOnDamageEvent, (PVOID)h_pOnDamageEvent);
// Remove call to Error for Geo bug: bullet trace ended at (%f, %f, %f), which is outside the max map coord:%i.
module.Offset(0x43D4D8).NOP(6);