CBaseCombatCharacter::CheckTraceHullAttack
0x005f15d0 · 1646 bytes · __thiscall
_ZN20CBaseCombatCharacter20CheckTraceHullAttackERK6VectorS2_S2_S2_iifb
Decompiled
undefined (9 params)
/* CBaseCombatCharacter::CheckTraceHullAttack(Vector const&, Vector const&, Vector const&, Vector
const&, int, int, float, bool) */
int * __thiscall
CBaseCombatCharacter::CheckTraceHullAttack
(CBaseCombatCharacter *this,Vector *param_1,Vector *param_2,Vector *param_3,
Vector *param_4,int param_5,int param_6,float param_7,bool param_8)
{
char cVar1;
int *piVar2;
float fVar3;
float fVar4;
float fVar5;
Vector local_160 [12];
Vector local_154 [8];
float local_14c;
undefined **local_148;
CBaseCombatCharacter *local_144;
undefined4 local_140;
CTakeDamageInfo *local_13c;
int *local_138;
float local_134;
undefined1 local_130;
float local_12c;
float local_128;
float local_124;
float local_11c;
float local_118;
float local_114;
float local_10c;
float local_108;
float local_104;
float local_fc;
float local_f8;
float local_f4;
undefined4 local_ec;
undefined1 local_e8;
undefined1 local_e7;
float local_d0;
float local_cc;
float local_c8;
float local_7c;
undefined4 local_78;
undefined4 local_74;
if (*(int *)(ai_show_hull_attacks._28_4_ + 0x30) != 0) {
local_d0 = *(float *)param_2 - *(float *)param_1;
local_cc = *(float *)(param_2 + 4) - *(float *)(param_1 + 4);
local_c8 = *(float *)(param_2 + 8) - *(float *)(param_1 + 8);
fVar4 = local_d0 * local_d0;
fVar3 = local_cc * local_cc;
fVar5 = local_c8 * local_c8;
VectorNormalize((Vector *)&local_d0);
local_78 = *(undefined4 *)(param_4 + 4);
local_7c = SQRT(fVar3 + fVar4 + fVar5) + *(float *)param_4;
local_74 = *(undefined4 *)(param_4 + 8);
NDebugOverlay::BoxDirection
(param_1,param_3,(Vector *)&local_7c,(Vector *)&local_d0,100,0xff,0xff,0x14,1.0);
NDebugOverlay::BoxDirection(param_1,param_3,param_4,(Vector *)&local_d0,0xff,0,0,0x14,1.0);
}
CTakeDamageInfo::CTakeDamageInfo
((CTakeDamageInfo *)&local_7c,(CBaseEntity *)this,(CBaseEntity *)this,(float)param_5,
param_6,0);
local_148 = &PTR_ShouldHitEntity_00c5bd18;
local_140 = 0xd;
local_134 = param_7;
local_144 = this;
local_138 = (int *)0x0;
local_ec = 0;
local_130 = param_8;
local_11c = *(float *)param_2 - *(float *)param_1;
local_118 = *(float *)(param_2 + 4) - *(float *)(param_1 + 4);
local_114 = *(float *)(param_2 + 8) - *(float *)(param_1 + 8);
local_e7 = local_118 * local_118 + local_11c * local_11c + local_114 * local_114 != 0.0;
local_f8 = (*(float *)(param_4 + 4) - *(float *)(param_3 + 4)) * 0.5;
local_f4 = (*(float *)(param_4 + 8) - *(float *)(param_3 + 8)) * 0.5;
local_fc = (*(float *)param_4 - *(float *)param_3) * 0.5;
local_e8 = local_f8 * local_f8 + local_fc * local_fc + local_f4 * local_f4 < 1e-06;
local_10c = (*(float *)param_4 + *(float *)param_3) * 0.5;
local_108 = (*(float *)(param_3 + 4) + *(float *)(param_4 + 4)) * 0.5;
local_104 = (*(float *)(param_3 + 8) + *(float *)(param_4 + 8)) * 0.5;
local_12c = *(float *)param_1 + local_10c;
local_10c = -local_10c;
local_128 = *(float *)(param_1 + 4) + local_108;
local_108 = -local_108;
local_124 = *(float *)(param_1 + 8) + local_104;
local_104 = -local_104;
local_13c = (CTakeDamageInfo *)&local_7c;
(**(code **)(*enginetrace + 0x14))(enginetrace,&local_12c,0x600400b,&local_148,&local_d0);
if (local_138 == (int *)0x0) {
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
fVar3 = *(float *)(this + 0x2e0);
fVar4 = *(float *)(this + 0x2e4);
CCollisionProperty::CollisionAABBToWorldAABB
((CCollisionProperty *)(this + 0x194),(Vector *)(this + 0x19c),
(Vector *)(this + 0x1a8),local_160,local_154);
local_ec = 0;
local_11c = *(float *)param_2 - fVar3;
local_118 = *(float *)(param_2 + 4) - fVar4;
local_114 = *(float *)(param_2 + 8) - (local_14c + 1.0);
local_e7 = local_118 * local_118 + local_11c * local_11c + local_114 * local_114 != 0.0;
local_f8 = (*(float *)(param_4 + 4) - *(float *)(param_3 + 4)) * 0.5;
local_fc = (*(float *)param_4 - *(float *)param_3) * 0.5;
local_10c = (*(float *)param_4 + *(float *)param_3) * 0.5;
local_f4 = (*(float *)(param_4 + 8) - *(float *)(param_3 + 8)) * 0.5;
local_e8 = local_f8 * local_f8 + local_fc * local_fc + local_f4 * local_f4 < 1e-06;
local_108 = (*(float *)(param_3 + 4) + *(float *)(param_4 + 4)) * 0.5;
local_104 = (*(float *)(param_3 + 8) + *(float *)(param_4 + 8)) * 0.5;
local_12c = fVar3 + local_10c;
local_124 = local_14c + 1.0 + local_104;
local_128 = fVar4 + local_108;
local_10c = -local_10c;
local_108 = -local_108;
local_104 = -local_104;
(**(code **)(*enginetrace + 0x14))(enginetrace,&local_12c,0x600400b,&local_148,&local_d0);
if (local_138 == (int *)0x0) {
return (int *)0x0;
}
}
piVar2 = local_138;
cVar1 = (**(code **)(*local_138 + 0x120))(local_138,this);
if (cVar1 == '\0') {
piVar2 = (int *)0x0;
}
return piVar2;
}
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.