CPropVehicleDriveable::VPhysicsCollision
0x00b33110 · 651 bytes · __thiscall
_ZN21CPropVehicleDriveable17VPhysicsCollisionEiP21gamevcollisionevent_t
Decompiled
undefined (3 params)
/* CPropVehicleDriveable::VPhysicsCollision(int, gamevcollisionevent_t*) */
void __thiscall
CPropVehicleDriveable::VPhysicsCollision
(CPropVehicleDriveable *this,int param_1,gamevcollisionevent_t *param_2)
{
CPropVehicleDriveable *pCVar1;
int iVar2;
int *piVar3;
uint uVar4;
CBaseEntity *pCVar5;
undefined *puVar6;
longdouble lVar7;
longdouble lVar8;
uint local_98;
Vector local_94 [12];
float local_88;
float local_84;
float local_80;
CTakeDamageInfo local_7c [108];
iVar2 = (**(code **)(*(int *)this + 0x3d0))(this);
if (iVar2 != 0) {
piVar3 = (int *)(**(code **)(*(int *)this + 0x3d0))(this);
piVar3 = (int *)(**(code **)(*piVar3 + 0x144))(piVar3);
if (piVar3 != (int *)0x0) {
pCVar1 = *(CPropVehicleDriveable **)(param_2 + (uint)(param_1 == 0) * 4 + 0x68);
if ((0.5 < *(float *)(param_2 + 0x14) || *(float *)(param_2 + 0x14) == 0.5) ||
(this != pCVar1)) {
CBaseEntity::VPhysicsCollision((CBaseEntity *)this,param_1,param_2);
uVar4 = *(uint *)(pCVar1 + 0x220);
if (((uVar4 != 0xffffffff) &&
(((puVar6 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc &&
(*(uint *)(puVar6 + 8) == uVar4 >> 0xc)) && (*(int *)(puVar6 + 4) != 0)))) &&
(((byte)pCVar1[0xd4] & 0x20) != 0)) {
iVar2 = (**(code **)(*piVar3 + 0x4f4))(piVar3,*(int *)(puVar6 + 4));
if (iVar2 == 3) {
return;
}
}
iVar2 = CBaseEntity::MyNPCPointer();
if (iVar2 == 0) {
piVar3 = *(int **)(param_2 + (uint)(param_1 == 0) * 4);
uVar4 = (**(code **)(*piVar3 + 0x50))(piVar3);
if ((uVar4 & 8) == 0) {
iVar2 = __dynamic_cast(pCVar1,&CBaseEntity::typeinfo,&CBreakable::typeinfo,0);
if (iVar2 == 0) {
local_98 = 0;
lVar7 = (longdouble)
CalculatePhysicsImpactDamage
(param_1,param_2,
(impactdamagetable_t *)gDefaultPlayerVehicleImpactDamageTable,1.0,
true,(int *)&local_98,false);
if ((0.0 < (float)lVar7) &&
(*(float *)(this + 0x1634) <= *(float *)(gpGlobals + 0xc) &&
*(float *)(gpGlobals + 0xc) != *(float *)(this + 0x1634))) {
(**(code **)(**(int **)(param_2 + 0x1c) + 4))(*(int **)(param_2 + 0x1c),local_94);
lVar8 = (longdouble)
(**(code **)(**(int **)(param_2 + param_1 * 4) + 0x78))
(*(int **)(param_2 + param_1 * 4));
iVar2 = param_1 * 0xc;
local_80 = (float)lVar8;
local_88 = *(float *)(param_2 + iVar2 + 0x38) * local_80;
uVar4 = local_98 | 0x10;
local_84 = *(float *)(param_2 + iVar2 + 0x3c) * local_80;
local_80 = local_80 * *(float *)(param_2 + iVar2 + 0x40);
pCVar5 = (CBaseEntity *)(**(code **)(*(int *)this + 0x3d0))(this);
CTakeDamageInfo::CTakeDamageInfo
(local_7c,(CBaseEntity *)this,pCVar5,(Vector *)&local_88,local_94,
(float)lVar7,uVar4,0,(Vector *)0x0);
pCVar5 = (CBaseEntity *)(**(code **)(*(int *)this + 0x3d0))(this);
CBaseEntity::TakeDamage(pCVar5,local_7c);
}
}
}
}
}
}
}
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.