CBaseCombatCharacter::VPhysicsShadowCollision
0x005f2ea0 · 883 bytes · __thiscall
_ZN20CBaseCombatCharacter23VPhysicsShadowCollisionEiP21gamevcollisionevent_t
Decompiled
undefined (3 params)
/* CBaseCombatCharacter::VPhysicsShadowCollision(int, gamevcollisionevent_t*) */
void __thiscall
CBaseCombatCharacter::VPhysicsShadowCollision
(CBaseCombatCharacter *this,int param_1,gamevcollisionevent_t *param_2)
{
float fVar1;
CBaseEntity *pCVar2;
float fVar3;
char cVar4;
CBaseEntity *pCVar5;
CBaseCombatCharacter *pCVar6;
impactdamagetable_t *piVar7;
undefined4 *puVar8;
CBasePlayer *this_00;
int *piVar9;
int iVar10;
longdouble lVar11;
uint local_98;
float local_94;
float local_90;
float local_8c;
Vector local_88 [12];
CTakeDamageInfo local_7c [52];
undefined4 local_48;
pCVar2 = *(CBaseEntity **)(param_2 + (uint)(param_1 == 0) * 4 + 0x68);
piVar9 = *(int **)(param_2 + (uint)(param_1 == 0) * 4);
if (((pCVar2 != (CBaseEntity *)0x0) && (pCVar2[0x104] != (CBaseEntity)0x1)) &&
(pCVar2[0x186] == (CBaseEntity)0x6)) {
cVar4 = (**(code **)(*piVar9 + 0x2c))(piVar9);
if (cVar4 != '\0') {
pCVar5 = (CBaseEntity *)CBaseEntity::GetGroundEntity((CBaseEntity *)this);
if (pCVar2 != pCVar5) {
pCVar6 = (CBaseCombatCharacter *)(**(code **)(*(int *)pCVar2 + 0x2c4))(pCVar2,0);
if (this != pCVar6) {
local_98 = 0;
if (((byte)this[0x14d] & 0x10) != 0) {
CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)this);
}
if (*(float *)(this + 0x27c) * *(float *)(this + 0x27c) +
*(float *)(this + 0x274) * *(float *)(this + 0x274) +
*(float *)(this + 0x278) * *(float *)(this + 0x278) <= 90000.0) {
fVar3 = *(float *)(this + 0x17fc);
piVar7 = (impactdamagetable_t *)(**(code **)(*(int *)this + 0x3c4))(this);
lVar11 = (longdouble)
CalculatePhysicsImpactDamage
(param_1,param_2,piVar7,fVar3,false,(int *)&local_98,false);
fVar3 = (float)lVar11;
if (0.0 < fVar3) {
fVar1 = *(float *)(phys_impactforcescale._28_4_ + 0x2c);
lVar11 = (longdouble)
(**(code **)(**(int **)(param_2 + param_1 * 4) + 0x78))
(*(int **)(param_2 + param_1 * 4));
local_8c = (float)lVar11;
iVar10 = param_1 * 0xc;
local_94 = *(float *)(param_2 + iVar10 + 0x38) * fVar1 * local_8c;
local_90 = *(float *)(param_2 + iVar10 + 0x3c) * fVar1 * local_8c;
local_8c = *(float *)(param_2 + iVar10 + 0x40) * fVar1 * local_8c;
puVar8 = (undefined4 *)(**(code **)(*(int *)pCVar2 + 0x18c))(pCVar2);
if (puVar8 != (undefined4 *)0x0) {
this_00 = (CBasePlayer *)(**(code **)*puVar8)(puVar8,0);
if (this_00 != (CBasePlayer *)0x0) {
local_98 = local_98 | 0x10;
local_8c = SQRT(local_8c * local_8c + local_94 * local_94 + local_90 * local_90) *
*(float *)(phys_upimpactforcescale._28_4_ + 0x2c) + local_8c;
cVar4 = (**(code **)(*(int *)this_00 + 0x16c))(this_00);
if (cVar4 != '\0') {
iVar10 = (**(code **)(*(int *)this + 0x1fc))(this);
if (fVar3 < (float)iVar10) {
CBasePlayer::RumbleEffect(this_00,'\x01','\0','\x04');
}
else {
CBasePlayer::RumbleEffect(this_00,'\x02','\0','\x04');
}
}
}
}
(**(code **)(**(int **)(param_2 + 0x1c) + 4))(*(int **)(param_2 + 0x1c),local_88);
CTakeDamageInfo::CTakeDamageInfo
(local_7c,pCVar2,pCVar2,(Vector *)&local_94,local_88,fVar3,local_98,0,
(Vector *)0x0);
piVar9 = (int *)(**(code **)(*(int *)pCVar2 + 0x2c4))(pCVar2,0x3f800000);
if (piVar9 != (int *)0x0) {
puVar8 = (undefined4 *)(**(code **)(*piVar9 + 0xc))(piVar9);
local_48 = *puVar8;
}
if (*(int *)(this + 0x448) != 0) {
CServerNetworkProperty::NetworkStateChanged((short)this + 0x24);
*(undefined4 *)(this + 0x448) = 0;
}
PhysCallbackDamage((CBaseEntity *)this,local_7c,param_2,param_1);
}
}
}
}
}
}
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.