CPhysHinge::InputSetVelocity
0x007768f0 · 583 bytes · __thiscall
_ZN10CPhysHinge16InputSetVelocityER11inputdata_t
Decompiled
undefined (2 params)
/* CPhysHinge::InputSetVelocity(inputdata_t&) */
void __thiscall CPhysHinge::InputSetVelocity(CPhysHinge *this,inputdata_t *param_1)
{
float fVar1;
code *pcVar2;
int iVar3;
char cVar4;
int iVar5;
int *piVar6;
float **ppfVar7;
float **ppfVar8;
float fVar9;
float fVar10;
int *apiStack_58 [2];
float local_50;
float *local_4c;
int *local_48;
float local_3c;
float local_38;
float local_34;
float local_30;
float local_28;
float local_24;
float local_20;
ppfVar7 = &local_4c;
ppfVar8 = &local_4c;
local_4c = *(float **)(this + 0x440);
if (local_4c == (float *)0x0) {
return;
}
local_50 = 1.0966116e-38;
iVar5 = (**(code **)((int)*local_4c + 0x18))();
if (iVar5 == 0) {
return;
}
local_4c = *(float **)(this + 0x440);
local_50 = 1.0966147e-38;
iVar5 = (**(code **)((int)*local_4c + 0x1c))();
if (iVar5 == 0) {
return;
}
local_30 = *(float *)(param_1 + 8);
if (*(int *)(param_1 + 0x18) != 1) {
local_30 = 0.0;
}
local_34 = 0.0;
local_4c = *(float **)(this + 0x440);
local_50 = 1.0966221e-38;
local_4c = (float *)(**(code **)((int)*local_4c + 0x18))();
local_50 = 1.0966232e-38;
cVar4 = (**(code **)((int)*local_4c + 0x2c))();
local_4c = *(float **)(this + 0x440);
if (cVar4 == '\0') {
local_50 = 1.0966258e-38;
local_4c = (float *)(**(code **)((int)*local_4c + 0x1c))();
local_50 = 1.0966269e-38;
cVar4 = (**(code **)((int)*local_4c + 0x2c))();
if (cVar4 == '\0') {
fVar10 = 1.0;
goto LAB_00776a2f;
}
local_38 = 1.0;
iVar5 = 0;
LAB_00776ab0:
iVar5 = iVar5 + 1;
iVar3 = **(int **)(this + 0x440);
*ppfVar8 = (float *)*(int **)(this + 0x440);
pcVar2 = *(code **)(iVar3 + 0x1c);
ppfVar8[-1] = (float *)0x776ac1;
piVar6 = (int *)(*pcVar2)();
iVar3 = *piVar6;
ppfVar8[1] = (float *)piVar6;
*ppfVar8 = &local_28;
pcVar2 = *(code **)(iVar3 + 0x80);
ppfVar8[-1] = (float *)0x776ad0;
(*pcVar2)();
ppfVar7 = ppfVar8 + -1;
iVar3 = **(int **)(this + 0x440);
ppfVar8[-1] = (float *)*(int **)(this + 0x440);
local_3c = local_28 * local_28 + local_24 * local_24 + local_20 * local_20;
local_38 = SQRT(local_3c) + local_38;
pcVar2 = *(code **)(iVar3 + 0x1c);
ppfVar8[-2] = (float *)0x776b1c;
piVar6 = (int *)(*pcVar2)();
iVar3 = *piVar6;
ppfVar8[-1] = (float *)piVar6;
pcVar2 = *(code **)(iVar3 + 100);
ppfVar8[-2] = (float *)0x776b24;
(*pcVar2)();
}
else {
local_50 = 1.0966308e-38;
local_48 = (int *)(**(code **)((int)*local_4c + 0x18))();
local_4c = &local_28;
iVar5 = 1;
local_50 = 1.096634e-38;
(**(code **)(*local_48 + 0x80))();
ppfVar7 = (float **)&local_50;
ppfVar8 = (float **)&local_50;
local_50 = *(float *)(this + 0x440);
local_38 = SQRT(local_28 * local_28 + local_24 * local_24 + local_20 * local_20);
local_50 = (float)(**(code **)(*(int *)local_50 + 0x18))();
(**(code **)(*(int *)local_50 + 100))();
local_50 = *(float *)(this + 0x440);
local_50 = (float)(**(code **)(*(int *)local_50 + 0x1c))();
cVar4 = (**(code **)(*(int *)local_50 + 0x2c))();
if (cVar4 != '\0') goto LAB_00776ab0;
}
fVar10 = local_38 / (float)iVar5;
LAB_00776a2f:
fVar9 = *(float *)(this + 0x4c4);
if (fVar9 == local_34) {
fVar9 = 1.0;
}
else {
fVar9 = fVar9 * fVar9;
}
piVar6 = *(int **)(this + 0x440);
fVar1 = *(float *)(gpGlobals + 0x1c);
iVar5 = *piVar6;
ppfVar7[1] = (float *)local_30;
*ppfVar7 = (float *)piVar6;
ppfVar7[2] = (float *)((fVar10 * local_30 * fVar9) / fVar1);
pcVar2 = *(code **)(iVar5 + 0x24);
ppfVar7[-1] = (float *)0x776a88;
(*pcVar2)();
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.