CIKContext::UpdateTargets
0x00b88ea0 · 4012 bytes · __thiscall
_ZN10CIKContext13UpdateTargetsEP6VectorP10QuaternionP11matrix3x4_tR12CBoneBitList
Decompiled
undefined (5 params)
/* CIKContext::UpdateTargets(Vector*, Quaternion*, matrix3x4_t*, CBoneBitList&) */
void __thiscall
CIKContext::UpdateTargets
(CIKContext *this,Vector *param_1,Quaternion *param_2,matrix3x4_t *param_3,
CBoneBitList *param_4)
{
float fVar1;
float fVar2;
float fVar3;
float fVar4;
CIKContext *pCVar5;
int iVar6;
CIKContext CVar7;
CIKContext *pCVar8;
int *piVar9;
int iVar10;
int iVar11;
int iVar12;
CIKContext *pCVar13;
CIKContext *pCVar14;
longdouble lVar15;
float fVar16;
float fVar17;
float fVar18;
float fVar19;
float fVar20;
float fVar21;
float fVar22;
float fVar23;
float local_e8;
float local_e4;
float local_d4;
float local_d0;
CIKContext *local_c8;
CIKContext *local_c4;
CIKContext *local_c0;
CIKContext *local_bc;
Quaternion *local_b8;
Quaternion *local_b0;
CIKContext *local_ac;
CIKContext *local_9c;
int local_94;
int local_90;
float local_88;
float local_84;
float local_80;
matrix3x4_t local_7c [48];
matrix3x4_t local_4c [60];
if (0 < *(int *)(this + 0xff0)) {
iVar10 = 0;
pCVar14 = this;
pCVar5 = this + 0xc;
pCVar8 = this + 0x18;
do {
*(undefined4 *)(pCVar14 + 0x5c) = 0;
iVar10 = iVar10 + 1;
*(undefined4 *)(pCVar14 + 0x44) = 0x3f800000;
*(undefined4 *)(pCVar14 + 0x48) = 0x3f800000;
*(undefined4 *)(pCVar14 + 0x4c) = 0;
*(undefined4 *)(pCVar14 + 0x50) = 0;
*(undefined4 *)(pCVar14 + 0x54) = 0;
*(undefined4 *)pCVar5 = 0;
*(undefined4 *)(pCVar5 + 4) = 0;
*(undefined4 *)(pCVar5 + 8) = 0;
*(undefined4 *)pCVar8 = 0;
*(undefined4 *)(pCVar8 + 4) = 0;
*(undefined4 *)(pCVar8 + 8) = 0;
*(undefined4 *)(pCVar8 + 0xc) = 0;
pCVar14 = pCVar14 + 0x154;
pCVar5 = pCVar5 + 0x154;
pCVar8 = pCVar8 + 0x154;
} while (iVar10 < *(int *)(this + 0xff0));
}
AutoIKRelease(this);
if (0 < *(int *)(this + 0x1008)) {
local_90 = 0;
local_94 = 0;
iVar10 = *(int *)(this + 0xffc);
do {
piVar9 = (int *)(iVar10 + local_90);
if (0 < piVar9[3]) {
iVar12 = 0;
do {
iVar11 = iVar12 * 0x84 + *piVar9;
iVar6 = *(int *)(iVar11 + 4);
if (iVar6 == 4) {
iVar10 = *(int *)(iVar11 + 0x10);
if (*(float *)(iVar11 + 100) <= 0.0) {
fVar19 = 1.0 - *(float *)(iVar11 + 0x5c);
if (*(float *)(this + iVar10 * 0x154 + 0x44) <= fVar19) {
fVar19 = *(float *)(this + iVar10 * 0x154 + 0x44);
}
*(float *)(this + iVar10 * 0x154 + 0x44) = fVar19;
}
else {
*(undefined4 *)(this + iVar10 * 0x154 + 0x44) = 0;
}
*(float *)(this + iVar10 * 0x154 + 0x5c) =
(1.0 - *(float *)(iVar11 + 0x60) * *(float *)(iVar11 + 0x5c)) *
*(float *)(this + iVar10 * 0x154 + 0x5c);
LAB_00b8906a:
iVar10 = *(int *)(this + 0xffc);
}
else if (iVar6 < 5) {
if (iVar6 == 3) goto LAB_00b8907d;
}
else if (iVar6 == 5) {
LAB_00b8907d:
pCVar14 = this + *(int *)(iVar11 + 0x10) * 0x154;
*(undefined4 *)pCVar14 = *(undefined4 *)(iVar11 + 8);
*(undefined4 *)(pCVar14 + 4) = *(undefined4 *)(iVar11 + 4);
if (*(int *)(iVar11 + 4) == 5) {
*(undefined4 *)(pCVar14 + 8) = *(undefined4 *)(iVar11 + 0x68);
}
else {
*(undefined4 *)(pCVar14 + 8) = 0;
}
if ((*(float *)(iVar11 + 0x60) == 1.0) || (*(float *)(pCVar14 + 0x5c) == 0.0)) {
*(undefined4 *)(pCVar14 + 0x18) = *(undefined4 *)(iVar11 + 0x2c);
*(undefined4 *)(pCVar14 + 0x1c) = *(undefined4 *)(iVar11 + 0x30);
*(undefined4 *)(pCVar14 + 0x20) = *(undefined4 *)(iVar11 + 0x34);
*(undefined4 *)(pCVar14 + 0x24) = *(undefined4 *)(iVar11 + 0x38);
*(undefined4 *)(pCVar14 + 0xc) = *(undefined4 *)(iVar11 + 0x20);
*(undefined4 *)(pCVar14 + 0x10) = *(undefined4 *)(iVar11 + 0x24);
*(undefined4 *)(pCVar14 + 0x14) = *(undefined4 *)(iVar11 + 0x28);
*(undefined4 *)(pCVar14 + 0x4c) = *(undefined4 *)(iVar11 + 0x14);
*(undefined4 *)(pCVar14 + 0x50) = *(undefined4 *)(iVar11 + 0x1c);
*(undefined4 *)(pCVar14 + 0x54) = *(undefined4 *)(iVar11 + 0x18);
*(float *)(pCVar14 + 0x44) = *(float *)(iVar11 + 0x60) * *(float *)(iVar11 + 100);
*(undefined4 *)(pCVar14 + 0x48) = *(undefined4 *)(iVar11 + 0x58);
*(float *)(pCVar14 + 0x5c) = *(float *)(iVar11 + 0x60) * *(float *)(iVar11 + 0x5c);
}
else {
QuaternionSlerp((Quaternion *)(pCVar14 + 0x18),(Quaternion *)(iVar11 + 0x2c),
*(float *)(iVar11 + 0x60),(Quaternion *)(pCVar14 + 0x18));
fVar19 = *(float *)(iVar11 + 0x60);
fVar1 = *(float *)(iVar11 + 0x28);
fVar16 = *(float *)(iVar11 + 0x20);
*(float *)(pCVar14 + 0x10) =
(*(float *)(iVar11 + 0x24) - *(float *)(pCVar14 + 0x10)) * fVar19 +
*(float *)(pCVar14 + 0x10);
*(float *)(pCVar14 + 0x14) =
(fVar1 - *(float *)(pCVar14 + 0x14)) * fVar19 + *(float *)(pCVar14 + 0x14);
*(float *)(pCVar14 + 0xc) =
(fVar16 - *(float *)(pCVar14 + 0xc)) * fVar19 + *(float *)(pCVar14 + 0xc);
*(float *)(pCVar14 + 0x4c) =
(*(float *)(iVar11 + 0x14) - *(float *)(pCVar14 + 0x4c)) *
*(float *)(iVar11 + 0x60) + *(float *)(pCVar14 + 0x4c);
*(float *)(pCVar14 + 0x50) =
(*(float *)(iVar11 + 0x1c) - *(float *)(pCVar14 + 0x50)) *
*(float *)(iVar11 + 0x60) + *(float *)(pCVar14 + 0x50);
*(float *)(pCVar14 + 0x54) =
(*(float *)(iVar11 + 0x18) - *(float *)(pCVar14 + 0x54)) *
*(float *)(iVar11 + 0x60) + *(float *)(pCVar14 + 0x54);
fVar19 = *(float *)(pCVar14 + 0x44);
if (*(float *)(iVar11 + 100) <= *(float *)(pCVar14 + 0x44)) {
fVar19 = *(float *)(iVar11 + 100);
}
*(float *)(pCVar14 + 0x44) = fVar19;
*(float *)(pCVar14 + 0x48) =
(*(float *)(iVar11 + 0x58) - *(float *)(pCVar14 + 0x48)) *
*(float *)(iVar11 + 0x60) + *(float *)(pCVar14 + 0x48);
*(float *)(pCVar14 + 0x5c) =
(*(float *)(iVar11 + 0x5c) - *(float *)(pCVar14 + 0x5c)) *
*(float *)(iVar11 + 0x60) + *(float *)(pCVar14 + 0x5c);
}
if (*(int *)(iVar11 + 4) != 3) goto LAB_00b8906a;
*(undefined4 *)(pCVar14 + 0x114) = 0;
*(float *)(pCVar14 + 0x68) = *(float *)(this + 0x1050) + *(float *)(pCVar14 + 0x50);
iVar10 = *(int *)(this + 0xffc);
}
else if (iVar6 == 6) {
fVar19 = 0.0;
if (*(float *)(iVar11 + 100) <= 0.0) {
fVar19 = 1.0 - *(float *)(iVar11 + 0x5c);
if (*(float *)(this + *(int *)(iVar11 + 0x10) * 0x154 + 0x44) <= fVar19) {
fVar19 = *(float *)(this + *(int *)(iVar11 + 0x10) * 0x154 + 0x44);
}
}
*(float *)(this + *(int *)(iVar11 + 0x10) * 0x154 + 0x44) = fVar19;
iVar10 = *(int *)(this + 0xffc);
}
iVar12 = iVar12 + 1;
piVar9 = (int *)(iVar10 + local_90);
} while (iVar12 < piVar9[3]);
}
local_94 = local_94 + 1;
local_90 = local_90 + 0x14;
} while (local_94 < *(int *)(this + 0x1008));
}
if (0 < *(int *)(this + 0xff0)) {
pCVar5 = this + 0x10c;
local_b8 = (Quaternion *)(this + 0x6c);
pCVar8 = this + 0x60;
pCVar13 = this + 0xf0;
local_94 = 0;
iVar10 = 0;
pCVar14 = this;
local_c8 = pCVar13;
local_c4 = pCVar5;
local_c0 = pCVar13;
local_bc = pCVar8;
local_b0 = (Quaternion *)(this + 0x118);
local_ac = pCVar5;
local_9c = pCVar8;
do {
if (0.0 < *(float *)(pCVar14 + 0x5c)) {
iVar12 = *(int *)*(CStudioHdr **)(this + 0xff8);
iVar12 = iVar12 + *(int *)pCVar14 * 0x10 + *(int *)(iVar12 + 0x120);
iVar6 = *(int *)(iVar12 + 0x38 + *(int *)(iVar12 + 0xc));
::BuildBoneChain(*(CStudioHdr **)(this + 0xff8),(matrix3x4_t *)(this + 0x1024),param_1,
param_2,iVar6,param_3,param_4);
QuaternionMatrix((Quaternion *)(this + iVar10 + 0x18),(Vector *)(this + iVar10 + 0xc),
local_7c);
MatrixInvert(local_7c,local_7c);
ConcatTransforms(param_3 + iVar6 * 0x30,local_7c,local_4c);
pCVar14[200] = (CIKContext)(*(float *)(pCVar14 + 0x44) == 1.0);
iVar6 = *(int *)(this + 0x1054);
if (((iVar6 < 0) || (*(int *)(pCVar14 + 0xd0) < iVar6 + -1)) ||
(iVar6 < *(int *)(pCVar14 + 0xd0))) {
pCVar14[0xc9] = (CIKContext)0x0;
*(int *)(pCVar14 + 0xcc) = 0;
iVar6 = *(int *)(this + 0x1054);
}
*(int *)(pCVar14 + 0xd0) = iVar6;
MatrixAngles(local_4c,(Quaternion *)(this + iVar10 + 0x34),(Vector *)(this + iVar10 + 0x28))
;
*(int *)(pCVar14 + 0x6c) = *(int *)(pCVar14 + 0x34);
*(int *)(pCVar14 + 0x70) = *(int *)(pCVar14 + 0x38);
*(int *)(pCVar14 + 0x74) = *(int *)(pCVar14 + 0x3c);
*(int *)(pCVar14 + 0x78) = *(int *)(pCVar14 + 0x40);
local_d0 = *(float *)(this + iVar10 + 0x28);
*(float *)(pCVar8 + (int)(local_9c + (-0x60 - (int)this))) = local_d0;
local_d4 = *(float *)(this + iVar10 + 0x2c);
*(float *)(pCVar8 + (int)(local_9c + (-0x5c - (int)this))) = local_d4;
local_e4 = *(float *)(this + iVar10 + 0x30);
*(float *)(pCVar8 + (int)(local_9c + (-0x58 - (int)this))) = local_e4;
fVar19 = *(float *)(pCVar14 + 0x44);
if (pCVar14[0xc9] == (CIKContext)0x0) {
CVar7 = (CIKContext)0x0;
}
else {
if (fVar19 == 1.0) {
fVar1 = *(float *)(pCVar13 + (int)(local_c8 + (-0xec - (int)this)));
fVar16 = *(float *)(pCVar13 + (int)(local_c8 + (-0xf0 - (int)this)));
*(float *)(pCVar5 + (int)(local_c4 + (-0x104 - (int)this))) =
*(float *)(pCVar13 + (int)(local_c8 + (-0xe8 - (int)this))) - local_e4;
*(float *)(pCVar5 + (int)(local_c4 + (-0x10c - (int)this))) = fVar16 - local_d0;
*(float *)(pCVar5 + (int)(local_c4 + (-0x108 - (int)this))) = fVar1 - local_d4;
QuaternionSM(-1.0,local_b8,(Quaternion *)(this + iVar10 + 0xfc),local_b0);
*(int *)(pCVar14 + 0x6c) = *(int *)(pCVar14 + 0xfc);
*(int *)(pCVar14 + 0x70) = *(int *)(pCVar14 + 0x100);
*(int *)(pCVar14 + 0x74) = *(int *)(pCVar14 + 0x104);
*(int *)(pCVar14 + 0x78) = *(int *)(pCVar14 + 0x108);
local_d0 = *(float *)(pCVar13 + (int)(local_c8 + (-0xf0 - (int)this)));
*(float *)(pCVar8 + (int)(local_9c + (-0x60 - (int)this))) = local_d0;
local_d4 = *(float *)(pCVar13 + (int)(local_c8 + (-0xec - (int)this)));
*(float *)(pCVar8 + (int)(local_9c + (-0x5c - (int)this))) = local_d4;
local_e4 = *(float *)(pCVar13 + (int)(local_c8 + (-0xe8 - (int)this)));
*(float *)(pCVar8 + (int)(local_9c + (-0x58 - (int)this))) = local_e4;
LAB_00b895b0:
CVar7 = pCVar14[0xc9];
}
else {
if (0.0 < fVar19) {
fVar1 = *(float *)(pCVar14 + 0xcc);
if (fVar19 < fVar1) {
fVar16 = fVar1 - fVar19;
if (0.0 < fVar1) {
fVar16 = fVar16 / fVar1;
}
fVar16 = 1.0 - fVar16;
*(float *)(pCVar5 + iVar10) =
*(float *)(pCVar5 + (int)(local_ac + (-0x10c - (int)this))) * fVar16;
*(float *)(this + iVar10 + 0x110) =
*(float *)(pCVar5 + (int)(local_ac + (-0x108 - (int)this))) * fVar16;
*(float *)(this + iVar10 + 0x114) =
*(float *)(pCVar5 + (int)(local_ac + (-0x104 - (int)this))) * fVar16;
QuaternionScale(local_b0,fVar16,local_b0);
local_d0 = *(float *)(pCVar8 + (int)(local_bc + (-0x60 - (int)this)));
local_d4 = *(float *)(pCVar8 + (int)(local_bc + (-0x5c - (int)this)));
local_e4 = *(float *)(pCVar8 + (int)(local_bc + (-0x58 - (int)this)));
}
fVar1 = *(float *)(pCVar5 + (int)(local_ac + (-0x108 - (int)this)));
fVar16 = *(float *)(pCVar5 + (int)(local_ac + (-0x104 - (int)this)));
*(float *)(pCVar8 + (int)(local_9c + (-0x60 - (int)this))) =
local_d0 + *(float *)(pCVar5 + (int)(local_ac + (-0x10c - (int)this)));
*(float *)(pCVar8 + (int)(local_9c + (-0x5c - (int)this))) = local_d4 + fVar1;
*(float *)(pCVar8 + (int)(local_9c + (-0x58 - (int)this))) = local_e4 + fVar16;
QuaternionMA(local_b8,1.0,local_b0,local_b8);
*(int *)(pCVar14 + 0xfc) = *(int *)(pCVar14 + 0x6c);
*(int *)(pCVar14 + 0x100) = *(int *)(pCVar14 + 0x70);
*(int *)(pCVar14 + 0x104) = *(int *)(pCVar14 + 0x74);
*(int *)(pCVar14 + 0x108) = *(int *)(pCVar14 + 0x78);
local_d0 = *(float *)(pCVar8 + (int)(local_bc + (-0x60 - (int)this)));
*(float *)(pCVar13 + (int)(local_c0 + (-0xf0 - (int)this))) = local_d0;
local_d4 = *(float *)(pCVar8 + (int)(local_bc + (-0x5c - (int)this)));
*(float *)(pCVar13 + (int)(local_c0 + (-0xec - (int)this))) = local_d4;
local_e4 = *(float *)(pCVar8 + (int)(local_bc + (-0x58 - (int)this)));
*(float *)(pCVar13 + (int)(local_c0 + (-0xe8 - (int)this))) = local_e4;
goto LAB_00b895b0;
}
pCVar14[0xc9] = (CIKContext)0x0;
*(int *)(pCVar14 + 0xfc) = *(int *)(pCVar14 + 0x6c);
*(int *)(pCVar14 + 0x100) = *(int *)(pCVar14 + 0x70);
*(int *)(pCVar14 + 0x104) = *(int *)(pCVar14 + 0x74);
*(int *)(pCVar14 + 0x108) = *(int *)(pCVar14 + 0x78);
*(float *)(pCVar13 + (int)(local_c0 + (-0xf0 - (int)this))) = local_d0;
*(float *)(pCVar13 + (int)(local_c0 + (-0xec - (int)this))) = local_d4;
*(float *)(pCVar13 + (int)(local_c0 + (-0xe8 - (int)this))) = local_e4;
*(undefined4 *)(pCVar5 + (int)(local_c4 + (-0x10c - (int)this))) = 0;
*(undefined4 *)(pCVar5 + (int)(local_c4 + (-0x108 - (int)this))) = 0;
*(undefined4 *)(pCVar5 + (int)(local_c4 + (-0x104 - (int)this))) = 0;
CVar7 = (CIKContext)0x0;
*(undefined4 *)(this + 0x118 + iVar10) = 0;
*(undefined4 *)(this + iVar10 + 0x11c) = 0;
*(undefined4 *)(this + iVar10 + 0x120) = 0;
*(undefined4 *)(this + iVar10 + 0x124) = 0;
}
*(float *)(pCVar14 + 0xcc) = fVar19;
}
iVar6 = *(int *)(iVar12 + 0xc);
iVar11 = *(int *)(iVar12 + iVar6);
fVar19 = *(float *)(param_3 + iVar11 * 0x30 + 0xc);
fVar1 = *(float *)(param_3 + iVar11 * 0x30 + 0x1c);
fVar16 = *(float *)(param_3 + iVar11 * 0x30 + 0x2c);
iVar11 = *(int *)(iVar12 + 0x1c + iVar6);
fVar2 = *(float *)(param_3 + iVar11 * 0x30 + 0xc);
fVar3 = *(float *)(param_3 + iVar11 * 0x30 + 0x1c);
fVar4 = *(float *)(param_3 + iVar11 * 0x30 + 0x2c);
iVar12 = *(int *)(iVar12 + 0x38 + iVar6);
fVar17 = SQRT((fVar2 - fVar19) * (fVar2 - fVar19) + (fVar4 - fVar16) * (fVar4 - fVar16) +
(fVar3 - fVar1) * (fVar3 - fVar1));
fVar21 = *(float *)(param_3 + iVar12 * 0x30 + 0x1c) - fVar3;
fVar20 = *(float *)(param_3 + iVar12 * 0x30 + 0x2c) - fVar4;
fVar18 = *(float *)(param_3 + iVar12 * 0x30 + 0xc) - fVar2;
fVar18 = SQRT(fVar18 * fVar18 + fVar21 * fVar21 + fVar20 * fVar20);
if (CVar7 == (CIKContext)0x0) {
fVar20 = ABS(fVar17 - fVar18);
}
else {
fVar23 = (*(float *)(param_3 + iVar12 * 0x30 + 0x1c) - fVar1) +
*(float *)(pCVar5 + (int)(local_ac + (-0x108 - (int)this)));
fVar22 = (*(float *)(param_3 + iVar12 * 0x30 + 0x2c) - fVar16) +
*(float *)(pCVar5 + (int)(local_ac + (-0x104 - (int)this)));
fVar21 = (*(float *)(param_3 + iVar12 * 0x30 + 0xc) - fVar19) +
*(float *)(pCVar5 + (int)(local_ac + (-0x10c - (int)this)));
fVar20 = ABS(fVar17 - fVar18);
fVar21 = SQRT(fVar23 * fVar23 + fVar22 * fVar22 + fVar21 * fVar21);
if ((fVar21 < fVar20) || (fVar18 + fVar17 < fVar21 * 0.95)) {
if (0.2 < *(float *)(pCVar14 + 0x44)) {
*(int *)(pCVar14 + 0x144) = *(int *)(this + 0x1058);
goto LAB_00b89bdd;
}
}
else if (0.2 < *(float *)(pCVar14 + 0x44)) {
LAB_00b89bdd:
if ((ABS(*(float *)(pCVar14 + 0x124)) + ABS(*(float *)(pCVar14 + 0x124))) - 1.0 < 0.707)
{
*(int *)(pCVar14 + 0x144) = *(int *)(this + 0x1058);
}
}
}
local_e8 = fVar18 + fVar17;
local_88 = local_d0 - fVar19;
local_84 = local_d4 - fVar1;
local_80 = local_e4 - fVar16;
lVar15 = (longdouble)VectorNormalize((Vector *)&local_88);
*(float *)(pCVar14 + 0x84) = fVar17;
*(float *)(pCVar14 + 0x80) = (float)lVar15;
fVar20 = fVar20 * 1.01;
*(float *)(pCVar14 + 0x88) = fVar18;
*(float *)(this + iVar10 + 0xa4) = fVar2;
*(float *)(this + iVar10 + 0x8c) = fVar19;
*(float *)(this + iVar10 + 0x94) = fVar16;
*(float *)(this + iVar10 + 0x90) = fVar1;
*(float *)(this + iVar10 + 0xa8) = fVar3;
*(float *)(this + iVar10 + 0xac) = fVar4;
*(float *)(this + iVar10 + 0xbc) = fVar19;
*(float *)(this + iVar10 + 0x98) = fVar20 * local_88 + fVar19;
*(float *)(this + iVar10 + 0xa0) = fVar20 * local_80 + fVar16;
*(float *)(this + iVar10 + 0x9c) = fVar20 * local_84 + fVar1;
*(float *)(this + iVar10 + 0xb0) = local_88 * 0.99 * local_e8 + fVar19;
*(float *)(this + iVar10 + 0xb4) = local_84 * 0.99 * local_e8 + fVar1;
*(float *)(this + iVar10 + 0xb8) = local_80 * 0.99 * local_e8 + fVar16;
*(float *)(this + iVar10 + 0xc0) = fVar1;
*(float *)(this + iVar10 + 0xc4) = fVar16 - local_e8 * 0.99;
}
local_94 = local_94 + 1;
iVar10 = iVar10 + 0x154;
pCVar14 = pCVar14 + 0x154;
local_ac = local_ac + 0x154;
local_9c = local_9c + 0x154;
local_c8 = local_c8 + 0x154;
local_c4 = local_c4 + 0x154;
local_b8 = local_b8 + 0x154;
local_b0 = local_b0 + 0x154;
local_bc = local_bc + 0x154;
local_c0 = local_c0 + 0x154;
} while (local_94 < *(int *)(this + 0xff0));
}
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.