FindMaxContact
0x0077a040 · 267 bytes · __cdecl
_Z14FindMaxContactP14IPhysicsObjectfPS0_P6VectorS3_
Decompiled
undefined (5 params)
/* FindMaxContact(IPhysicsObject*, float, IPhysicsObject**, Vector*, Vector*) */
undefined4
FindMaxContact(IPhysicsObject *param_1,float param_2,IPhysicsObject **param_3,Vector *param_4,
Vector *param_5)
{
float fVar1;
char cVar2;
int *piVar3;
IPhysicsObject *pIVar4;
longdouble lVar5;
longdouble lVar6;
lVar5 = (longdouble)(**(code **)(*(int *)param_1 + 0x78))(param_1);
*param_3 = (IPhysicsObject *)0x0;
piVar3 = (int *)(**(code **)(*(int *)param_1 + 0x144))(param_1);
while( true ) {
cVar2 = (**(code **)(*piVar3 + 8))(piVar3);
if (cVar2 == '\0') break;
pIVar4 = (IPhysicsObject *)(**(code **)(*piVar3 + 0xc))(piVar3,1);
cVar2 = (**(code **)(*(int *)pIVar4 + 0x2c))(pIVar4);
if (cVar2 != '\0') {
lVar6 = (longdouble)(**(code **)(*(int *)pIVar4 + 0x78))(pIVar4);
if ((float)lVar5 < (float)lVar6) {
lVar6 = (longdouble)(**(code **)(*piVar3 + 0x1c))(piVar3);
fVar1 = (float)lVar6;
if (param_2 < fVar1) {
*param_3 = pIVar4;
(**(code **)(*piVar3 + 0x14))(piVar3,param_4);
(**(code **)(*piVar3 + 0x18))(piVar3,param_5);
*(float *)param_5 = *(float *)param_5 * fVar1;
*(float *)(param_5 + 4) = *(float *)(param_5 + 4) * fVar1;
*(float *)(param_5 + 8) = fVar1 * *(float *)(param_5 + 8);
}
}
}
(**(code **)(*piVar3 + 0x34))(piVar3);
}
(**(code **)(*(int *)param_1 + 0x148))(param_1,piVar3);
return CONCAT31((int3)((uint)*param_3 >> 8),*param_3 != (IPhysicsObject *)0x0);
}
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.