CIKContext::AutoIKRelease
0x00b889f0 · 1158 bytes · __thiscall
_ZN10CIKContext13AutoIKReleaseEv
Decompiled
undefined (1 param)
/* CIKContext::AutoIKRelease() */
void __thiscall CIKContext::AutoIKRelease(CIKContext *this)
{
CUtlVector<ikcontextikrule_t,CUtlMemory<ikcontextikrule_t,int>> *this_00;
int iVar1;
int *piVar2;
int iVar3;
undefined4 *puVar4;
int iVar5;
int iVar6;
CIKContext *pCVar7;
float fVar8;
float fVar9;
float fVar10;
float fVar11;
int local_b0;
undefined4 local_a0;
undefined4 local_8c;
undefined4 local_88;
undefined4 local_84;
undefined4 local_80;
undefined4 local_7c;
undefined4 local_78;
undefined4 local_74;
undefined4 local_70;
undefined4 local_6c;
undefined4 local_68;
undefined4 local_64;
undefined4 local_60;
undefined4 local_5c;
undefined4 local_58;
undefined4 local_54;
undefined4 local_50;
undefined4 local_4c;
undefined4 local_48;
undefined4 local_38;
undefined4 local_34;
undefined4 local_30;
undefined4 local_2c;
undefined4 local_28;
undefined4 local_24;
undefined4 local_20;
if (0 < *(int *)(this + 0xff0)) {
local_b0 = 0;
pCVar7 = this;
do {
fVar8 = *(float *)(this + 0x1058);
fVar10 = *(float *)(pCVar7 + 0x144);
fVar11 = fVar8 - fVar10;
if (pCVar7[0x150] == (CIKContext)0x0) {
if (fVar11 < 0.5) {
*(int *)(pCVar7 + 0x14c) = 0;
fVar9 = 0.0;
*(float *)(pCVar7 + 0x148) = fVar10;
pCVar7[0x150] = (CIKContext)0x1;
fVar8 = *(float *)(this + 0x1058);
goto LAB_00b88a33;
}
}
else {
fVar10 = *(float *)(pCVar7 + 0x148);
fVar9 = *(float *)(pCVar7 + 0x14c);
LAB_00b88a33:
if (0.25 <= fVar11) {
fVar9 = fVar9 - (fVar8 - fVar10) * 4.0;
if (fVar9 <= 0.0) {
fVar9 = 0.0;
}
*(float *)(pCVar7 + 0x14c) = fVar9;
if (0.0 < fVar9) goto LAB_00b88a7f;
LAB_00b88bec:
pCVar7[0x150] = (CIKContext)0x0;
goto LAB_00b88b29;
}
fVar9 = (fVar8 - fVar10) * 4.0 + fVar9;
if (1.0 <= fVar9) {
fVar9 = 1.0;
}
*(float *)(pCVar7 + 0x14c) = fVar9;
if (fVar9 <= 0.0) goto LAB_00b88bec;
LAB_00b88a7f:
iVar1 = *(int *)pCVar7;
piVar2 = *(int **)(this + 0xff8);
fVar10 = fVar9 * fVar9 * 3.0 - (fVar9 + fVar9) * fVar9 * fVar9;
if (iVar1 < 0) {
iVar3 = *piVar2;
iVar6 = *(int *)(iVar3 + 0x11c);
LAB_00b88c08:
DevWarning(1,"AutoIKRelease (%s) got an out of range chain %d (%d)\n",iVar3 + 0xc,iVar1,
iVar6);
}
else {
iVar3 = *piVar2;
iVar6 = *(int *)(iVar3 + 0x11c);
if (iVar6 <= iVar1) goto LAB_00b88c08;
iVar6 = iVar1 * 0x10 + *(int *)(iVar3 + 0x120) + iVar3;
if (iVar6 == 0) {
DevWarning(1,"AutoIKRelease (%s) got a NULL pchain %d\n",iVar3 + 0xc,iVar1);
}
else {
iVar6 = *(int *)(iVar6 + 0x38 + *(int *)(iVar6 + 0xc));
if (iVar6 < 0) {
iVar5 = *(int *)(iVar3 + 0x9c);
}
else {
iVar5 = *(int *)(iVar3 + 0x9c);
if (iVar6 < iVar5) {
if (iVar6 * 0xd8 + *(int *)(iVar3 + 0xa0) + iVar3 == 0) {
DevWarning(1,"AutoIKRelease (%s) got a NULL pBone %d\n",iVar3 + 0xc,iVar6);
}
else {
if ((*(uint *)(this + 0x105c) & *(uint *)(piVar2[0xb] + iVar6 * 4)) == 0) {
pCVar7[0x150] = (CIKContext)0x0;
goto LAB_00b88b39;
}
this_00 = (CUtlVector<ikcontextikrule_t,CUtlMemory<ikcontextikrule_t,int>> *)
(*(int *)(this + 0xffc) + iVar1 * 0x14);
iVar3 = *(int *)(this_00 + 0xc);
CUtlVector<ikcontextikrule_t,CUtlMemory<ikcontextikrule_t,int>>::GrowVector
(this_00,1);
CUtlVector<ikcontextikrule_t,CUtlMemory<ikcontextikrule_t,int>>::
ShiftElementsRight(this_00,iVar3,1);
puVar4 = (undefined4 *)
(iVar3 * 0x84 + *(int *)(*(int *)(this + 0xffc) + iVar1 * 0x14));
puVar4[5] = local_8c;
*puVar4 = local_a0;
puVar4[6] = local_88;
puVar4[2] = iVar1;
puVar4[7] = local_84;
puVar4[0xb] = local_74;
puVar4[8] = local_80;
puVar4[1] = 4;
puVar4[9] = local_7c;
puVar4[0xc] = local_70;
puVar4[10] = local_78;
puVar4[3] = 0;
puVar4[0xf] = local_64;
puVar4[0xd] = local_6c;
puVar4[4] = local_b0;
puVar4[0xe] = local_68;
puVar4[0x10] = local_60;
puVar4[0x18] = 0x3f800000;
puVar4[0x19] = -(uint)(0.25 <= fVar11) & (uint)fVar10;
puVar4[0x11] = local_5c;
puVar4[0x1b] = local_34;
puVar4[0x12] = local_58;
puVar4[0x1c] = local_30;
puVar4[0x13] = local_54;
puVar4[0x1d] = local_2c;
puVar4[0x14] = local_50;
puVar4[0x1e] = local_28;
puVar4[0x15] = local_4c;
puVar4[0x1f] = local_24;
puVar4[0x17] = fVar10;
puVar4[0x16] = local_48;
puVar4[0x1a] = local_38;
puVar4[0x20] = local_20;
}
goto LAB_00b88b29;
}
}
DevWarning(1,"AutoIKRelease (%s) got an out of range bone %d (%d)\n",iVar3 + 0xc,iVar6,
iVar5);
}
}
LAB_00b88b29:
*(int *)(pCVar7 + 0x148) = *(int *)(this + 0x1058);
}
LAB_00b88b39:
local_b0 = local_b0 + 1;
pCVar7 = pCVar7 + 0x154;
} while (local_b0 < *(int *)(this + 0xff0));
}
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.