CHangRope::ApplyConstraints
0x004a5ab0 · 288 bytes · __thiscall
_ZN9CHangRope16ApplyConstraintsEPN14CSimplePhysics5CNodeEi
Decompiled
undefined (3 params)
/* CHangRope::ApplyConstraints(CSimplePhysics::CNode*, int) */
void __thiscall CHangRope::ApplyConstraints(CHangRope *this,CNode *param_1,int param_2)
{
CNode *pCVar1;
int iVar2;
int iVar3;
int iVar4;
float fVar5;
float fVar6;
CBaseRopePhysics::ApplyConstraints((CBaseRopePhysics *)this,param_1,param_2);
pCVar1 = param_1 + param_2 * 0x24 + -0x24;
fVar6 = 0.0;
*(undefined4 *)param_1 = *(undefined4 *)(this + 0x6028);
*(undefined4 *)(param_1 + 4) = *(undefined4 *)(this + 0x602c);
*(undefined4 *)(param_1 + 8) = *(undefined4 *)(this + 0x6030);
*(undefined4 *)pCVar1 = *(undefined4 *)(this + 0x6034);
*(undefined4 *)(pCVar1 + 4) = *(undefined4 *)(this + 0x6038);
*(undefined4 *)(pCVar1 + 8) = *(undefined4 *)(this + 0x603c);
iVar2 = *(int *)(this + 0xc);
if (0 < iVar2) {
fVar6 = 0.0;
iVar3 = *(int *)(this + 8);
do {
iVar4 = iVar3 + 0x24;
fVar5 = ABS(*(float *)(this + 0x6050) - *(float *)(iVar3 + 8));
if (fVar6 <= fVar5) {
fVar6 = fVar5;
}
iVar3 = iVar4;
} while (iVar4 != *(int *)(this + 8) + iVar2 * 0x24);
}
if (fVar6 < *(float *)(this + 0x604c)) {
fVar6 = *(float *)(this + 0x6048) + 1.0;
*(float *)(this + 0x6048) = fVar6;
}
else {
fVar6 = *(float *)(this + 0x6048) - 1.0;
*(float *)(this + 0x6048) = fVar6;
}
CBaseRopePhysics::ResetSpringLength
((CBaseRopePhysics *)this,
(fVar6 + *(float *)(this + 0x6044) + -100.0) / (float)(iVar2 + -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.