WasAttackedFromFront
0x00a0e5f0 · 365 bytes · __cdecl
_Z20WasAttackedFromFrontP8InfectedRK15CTakeDamageInfo
Decompiled
undefined (2 params)
/* WasAttackedFromFront(Infected*, CTakeDamageInfo const&) */
bool WasAttackedFromFront(Infected *param_1,CTakeDamageInfo *param_2)
{
uint uVar1;
float *pfVar2;
float *pfVar3;
undefined *puVar4;
int *piVar5;
float local_40;
float local_3c;
float local_38;
float local_34;
float local_30;
float local_2c;
Vector local_28 [24];
if (((byte)param_2[0x4a] & 0x20) == 0) {
uVar1 = *(uint *)(param_2 + 0x30);
piVar5 = (int *)0x0;
if (((uVar1 != 0xffffffff) &&
(puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) {
piVar5 = *(int **)(puVar4 + 4);
}
pfVar2 = (float *)(**(code **)(*piVar5 + 0x288))(piVar5);
local_3c = *(float *)(param_2 + 0x10) - pfVar2[1];
local_40 = *(float *)(param_2 + 0xc) - *pfVar2;
local_38 = *(float *)(param_2 + 0x14) - pfVar2[2];
}
else {
uVar1 = *(uint *)(param_2 + 0x34);
piVar5 = (int *)0x0;
if (((uVar1 != 0xffffffff) &&
(puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) {
piVar5 = *(int **)(puVar4 + 4);
}
pfVar2 = (float *)(**(code **)(*piVar5 + 0x288))(piVar5);
pfVar3 = (float *)(**(code **)(*(int *)param_1 + 0x288))(param_1);
local_40 = *pfVar3 - *pfVar2;
local_3c = pfVar3[1] - pfVar2[1];
local_38 = pfVar3[2] - pfVar2[2];
}
VectorNormalize((Vector *)&local_40);
CBaseAnimating::GetAttachment
((CBaseAnimating *)param_1,"chest",local_28,(Vector *)&local_34,(Vector *)0x0,
(Vector *)0x0);
return local_3c * local_30 + local_40 * local_34 + local_38 * local_2c < 0.0;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.