CSheetSimulator::InitPosition
0x004b0170 · 682 bytes · __thiscall
_ZN15CSheetSimulator12InitPositionEi
Decompiled
undefined (2 params)
/* CSheetSimulator::InitPosition(int) */
void __thiscall CSheetSimulator::InitPosition(CSheetSimulator *this,int param_1)
{
float *pfVar1;
int iVar2;
int iVar3;
undefined4 *puVar4;
float *pfVar5;
longdouble lVar6;
float fVar7;
float fVar8;
float local_7c;
float local_78;
float local_74;
undefined1 local_70 [24];
undefined4 local_58;
undefined4 local_54;
undefined4 local_50;
undefined4 local_4c;
undefined4 local_48;
float local_44;
char local_3a;
char local_39;
iVar3 = param_1 * 0xc;
(**(code **)(this + 0x48))
(this + 0x60,*(int *)(this + 0x18) + iVar3,this + 0x78,this + 0x84,0x400b,
*(undefined4 *)(this + 0x5c),local_70);
if (local_44 < 1.0) {
iVar2 = param_1 * 0x14;
puVar4 = (undefined4 *)(*(int *)(this + 0x90) + iVar2);
*puVar4 = local_58;
puVar4[1] = local_54;
puVar4[2] = local_50;
puVar4[3] = local_4c;
puVar4[4] = local_48;
*(float *)(iVar2 + *(int *)(this + 0x90) + 0xc) =
*(float *)(iVar2 + *(int *)(this + 0x90) + 0xc) + 6.0;
pfVar1 = (float *)(iVar3 + *(int *)(this + 0x18));
local_7c = *pfVar1 - *(float *)(this + 0x60);
local_78 = pfVar1[1] - *(float *)(this + 100);
local_74 = pfVar1[2] - *(float *)(this + 0x68);
lVar6 = (longdouble)VectorNormalize((Vector *)&local_7c);
pfVar1 = (float *)(*(int *)(this + 0x90) + iVar2);
fVar7 = ((pfVar1[3] - (*(float *)(this + 100) * pfVar1[1] + *(float *)(this + 0x68) * pfVar1[2])
) - *pfVar1 * *(float *)(this + 0x60)) /
(pfVar1[1] * local_78 + *pfVar1 * local_7c + pfVar1[2] * local_74);
iVar3 = param_1 * 0x34 + *(int *)(this + 8);
fVar8 = (float)(int)lVar6;
if (fVar7 <= (float)(int)lVar6) {
fVar8 = fVar7;
}
*(float *)(iVar3 + 4) = local_7c * fVar8 + *(float *)(this + 0x60);
*(float *)(iVar3 + 8) = local_78 * fVar8 + *(float *)(this + 100);
*(float *)(iVar3 + 0xc) = fVar8 * local_74 + *(float *)(this + 0x68);
*(undefined1 *)(*(int *)(this + 0x94) + param_1) = 1;
return;
}
if ((local_3a == '\0') && (local_39 == '\0')) {
puVar4 = (undefined4 *)(iVar3 + *(int *)(this + 0x18));
iVar3 = param_1 * 0x34 + *(int *)(this + 8);
*(undefined4 *)(iVar3 + 4) = *puVar4;
*(undefined4 *)(iVar3 + 8) = puVar4[1];
*(undefined4 *)(iVar3 + 0xc) = puVar4[2];
*(undefined1 *)(*(int *)(this + 0x94) + param_1) = 0;
return;
}
*(undefined1 *)(*(int *)(this + 0x94) + param_1) = 1;
pfVar5 = (float *)(iVar3 + *(int *)(this + 0x18));
iVar3 = param_1 * 0x14;
pfVar1 = (float *)(*(int *)(this + 0x90) + iVar3);
*pfVar1 = *(float *)(this + 0x60) - *pfVar5;
pfVar1[1] = *(float *)(this + 100) - pfVar5[1];
pfVar1[2] = *(float *)(this + 0x68) - pfVar5[2];
VectorNormalize((Vector *)(*(int *)(this + 0x90) + iVar3));
pfVar1 = (float *)(*(int *)(this + 0x90) + iVar3);
pfVar1[3] = *pfVar1 * *(float *)(this + 0x60) + pfVar1[1] * *(float *)(this + 100) + -6.0 +
pfVar1[2] * *(float *)(this + 0x68);
*(undefined1 *)(*(int *)(this + 0x90) + 0x10 + iVar3) = 3;
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.