CTerrorPlayer::AddJockeyContribution
0x004f5170 · 781 bytes · __thiscall
_ZN13CTerrorPlayer21AddJockeyContributionEPfS0_
Decompiled
undefined (3 params)
/* CTerrorPlayer::AddJockeyContribution(float*, float*) */
void __thiscall
CTerrorPlayer::AddJockeyContribution(CTerrorPlayer *this,float *param_1,float *param_2)
{
uint uVar1;
int *piVar2;
char cVar3;
int iVar4;
int iVar5;
undefined *puVar6;
float fVar7;
float fVar8;
float fVar9;
float fVar10;
float fVar11;
float fVar12;
double dVar13;
float local_24;
float local_20 [4];
uVar1 = *(uint *)(this + 0x3ee0);
if ((((uVar1 != 0xffffffff) &&
(puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar6 + 8) == uVar1 >> 0xc)) &&
(piVar2 = *(int **)(puVar6 + 4), piVar2 != (int *)0x0)) {
iVar4 = (**(code **)(*(int *)this + 0x238))(this);
sincosf(*(float *)(iVar4 + 4) * 0.017453292,local_20,&local_24);
fVar8 = (float)piVar2[0xfbb];
fVar7 = (float)piVar2[0xfba];
cVar3 = (**(code **)(*piVar2 + 0x778))(piVar2);
if (cVar3 == '\0') {
fVar9 = local_20[0] * fVar8 + local_24 * fVar7;
fVar8 = local_20[0] * fVar7 - fVar8 * local_24;
}
else {
fVar9 = (float)piVar2[0xfba];
fVar8 = (float)piVar2[0xfbb];
}
fVar7 = SQRT(fVar9 * fVar9 + fVar8 * fVar8);
if (0.001 < fVar7) {
fVar9 = fVar9 / fVar7;
fVar8 = fVar8 / fVar7;
}
dVar13 = sin((double)(float)piVar2[0xfb0]);
fVar7 = *(float *)(ZombieJockeyControlVariance._28_4_ + 0x2c);
iVar4 = *(int *)(this + 0x100);
iVar5 = (**(code **)(*(int *)this + 0x1fc))(this);
fVar7 = (float)((double)fVar7 * 0.5 * dVar13) + *(float *)(ZombieJockeyControlMin._28_4_ + 0x2c)
+ (1.0 - (float)iVar4 / (float)iVar5) *
(*(float *)(ZombieJockeyControlMax._28_4_ + 0x2c) -
*(float *)(ZombieJockeyControlMin._28_4_ + 0x2c));
fVar11 = *param_1 * 0.004;
fVar10 = *param_2 * 0.004;
if (1.0 <= fVar7) {
fVar7 = 1.0;
}
if (fVar7 <= 0.0) {
fVar7 = 0.0;
}
fVar12 = SQRT(fVar11 * fVar11 + fVar10 * fVar10);
if (0.001 < fVar12) {
fVar11 = fVar11 / fVar12;
fVar10 = fVar10 / fVar12;
}
*param_1 = fVar11 * (1.0 - fVar7) + fVar9 * fVar7;
*param_2 = (1.0 - fVar7) * fVar10 + fVar7 * fVar8;
*param_1 = *param_1 * 250.0;
*param_2 = *param_2 * 250.0;
dVar13 = cos((double)(float)piVar2[0xfae]);
*param_1 = (float)(dVar13 * (double)*(float *)(ZombieJockeyStaggerAmount._28_4_ + 0x2c) +
(double)*param_1);
dVar13 = cos((double)(float)piVar2[0xfaf]);
*param_2 = (float)(dVar13 * (double)*(float *)(ZombieJockeyStaggerAmount._28_4_ + 0x2c) +
(double)*param_2);
return;
}
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.