cast_hull
0x00640780 · 1550 bytes · __cdecl
_ZL9cast_hullRK8CCommand
Decompiled
undefined (1 param)
/* cast_hull(CCommand const&) */
void cast_hull(CCommand *param_1)
{
CBaseEntity *pCVar1;
CBasePlayer *this;
undefined1 *puVar2;
undefined4 uVar3;
undefined4 uVar4;
CBaseEntity *pCVar5;
double dVar6;
double dVar7;
double dVar8;
double local_11c;
double local_114;
float local_100;
float local_fc;
float local_f8;
float local_f4;
float local_f0;
float local_ec;
undefined4 local_e8;
undefined4 local_e4;
undefined4 local_e0;
float local_dc;
float local_d8;
float local_d4;
float local_cc;
float local_c8;
float local_c4;
float local_bc;
float local_b8;
float local_b4;
undefined4 local_ac;
undefined4 local_a8;
undefined4 local_a4;
float local_9c;
float local_98;
float local_94;
undefined4 local_8c;
undefined1 local_88;
undefined1 local_87;
Vector local_70 [12];
float local_64;
float local_60;
float local_5c;
float local_58;
float local_54;
float local_50;
float local_44;
char local_3a;
char local_39;
undefined4 local_34;
short local_30;
undefined4 local_2c;
short local_28;
CBaseEntity *local_24;
undefined4 local_20;
this = (CBasePlayer *)UTIL_GetCommandClient();
local_f4 = 16.0;
local_f0 = 16.0;
local_ec = 16.0;
CBasePlayer::EyeVectors(this,(Vector *)&local_100,(Vector *)0x0,(Vector *)0x0);
(**(code **)(*(int *)this + 0x234))((Vector *)&local_e8,this);
local_8c = 0;
local_bc = local_100 * 16384.0;
local_b8 = local_fc * 16384.0;
local_b4 = local_f8 * 16384.0;
local_98 = local_f0;
local_9c = local_f4;
local_94 = local_ec;
local_ac = 0;
local_a8 = 0;
local_a4 = 0;
local_87 = local_b8 * local_b8 + local_bc * local_bc + local_b4 * local_b4 != 0.0;
local_88 = local_f0 * local_f0 + local_f4 * local_f4 + local_ec * local_ec < 1e-06;
local_cc = (float)local_e8;
local_c8 = (float)local_e4;
local_c4 = (float)local_e0;
CTraceFilterSimple::CTraceFilterSimple
((CTraceFilterSimple *)&local_dc,(IHandleEntity *)this,0,
(_func_bool_IHandleEntity_ptr_int *)0x0);
(**(code **)(*enginetrace + 0x14))
(enginetrace,(Vector *)&local_cc,0x200400b,(CTraceFilterSimple *)&local_dc);
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
DebugDrawLine(local_70,(Vector *)&local_64,0xff,0xff,0,true,-1.0);
}
pCVar1 = local_24;
if ((local_44 < 1.0) || (local_3a != '\0')) {
if (((byte)local_24[0x14d] & 8) != 0) goto LAB_00640c36;
LAB_006409ba:
local_11c = (double)*(float *)(local_24 + 900);
LAB_006409cd:
local_114 = (double)*(float *)(local_24 + 0x380);
LAB_006409e0:
dVar7 = (double)*(float *)(local_24 + 0x37c);
LAB_006409eb:
dVar8 = (double)*(float *)(local_24 + 0x2e8);
}
else {
if (local_39 == '\0') {
return;
}
if (((byte)local_24[0x14d] & 8) == 0) goto LAB_006409ba;
LAB_00640c36:
CBaseEntity::CalcAbsolutePosition(local_24);
pCVar5 = local_24;
local_11c = (double)*(float *)(pCVar1 + 900);
if (((byte)local_24[0x14d] & 8) == 0) goto LAB_006409cd;
CBaseEntity::CalcAbsolutePosition(local_24);
pCVar1 = local_24;
local_114 = (double)*(float *)(pCVar5 + 0x380);
if (((byte)local_24[0x14d] & 8) == 0) goto LAB_006409e0;
CBaseEntity::CalcAbsolutePosition(local_24);
pCVar5 = local_24;
dVar7 = (double)*(float *)(pCVar1 + 0x37c);
if (((byte)local_24[0x14d] & 8) == 0) goto LAB_006409eb;
CBaseEntity::CalcAbsolutePosition(local_24);
pCVar1 = local_24;
dVar8 = (double)*(float *)(pCVar5 + 0x2e8);
if (((byte)local_24[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(local_24);
pCVar5 = local_24;
dVar6 = (double)*(float *)(pCVar1 + 0x2e4);
if (((byte)local_24[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(local_24);
}
goto LAB_00640a03;
}
}
dVar6 = (double)*(float *)(local_24 + 0x2e4);
pCVar5 = local_24;
LAB_00640a03:
puVar2 = &DAT_00d539c2;
if (*(undefined1 **)(local_24 + 0x7c) != (undefined1 *)0x0) {
puVar2 = *(undefined1 **)(local_24 + 0x7c);
}
DevMsg(1,"Hit %s\nposition %.2f, %.2f, %.2f\nangles %.2f, %.2f, %.2f\n",puVar2,
(double)*(float *)(pCVar5 + 0x2e0),dVar6,dVar8,dVar7,local_114,local_11c);
uVar3 = (**(code **)(*physprops + 0x20))(physprops,(int)local_30);
uVar4 = (**(code **)(*(int *)(local_24 + 0x194) + 0x2c))(local_24 + 0x194);
DevMsg(1,"Hit: hitbox %d, hitgroup %d, physics bone %d, solid %d, surface %s, surfaceprop %s\n",
local_20,local_2c,(int)local_28,uVar4,local_34,uVar3);
local_c4 = -local_ec;
local_c8 = -local_f0;
local_cc = -local_f4;
NDebugOverlay::SweptBox
((Vector *)&local_e8,(Vector *)&local_64,(Vector *)&local_cc,(Vector *)&local_f4,
(QAngle *)&vec3_angle,0,0,0xff,0,10.0);
local_dc = local_64;
local_d8 = local_60;
local_c8 = local_54 * 24.0 + local_60;
local_cc = local_58 * 24.0 + local_64;
local_d4 = local_5c;
local_c4 = local_50 * 24.0 + local_5c;
NDebugOverlay::Line((Vector *)&local_dc,(Vector *)&local_cc,0xff,0xff,0x40,false,10.0);
return;
}
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.