CBaseEntity::ComputeStepSimulationNetwork
0x0060d3d0 · 986 bytes · __thiscall
_ZN11CBaseEntity28ComputeStepSimulationNetworkEP18StepSimulationData
Decompiled
undefined (2 params)
/* CBaseEntity::ComputeStepSimulationNetwork(StepSimulationData*) */
void __thiscall
CBaseEntity::ComputeStepSimulationNetwork(CBaseEntity *this,StepSimulationData *param_1)
{
float fVar1;
float fVar2;
code *pcVar3;
int iVar4;
StepSimulationData *pSVar5;
int *piVar6;
int iVar7;
float fVar8;
float fVar9;
float fVar10;
float fVar11;
StepSimulationData *local_34;
StepSimulationData *local_30;
float local_2c;
float local_28;
float local_24;
if ((param_1 != (StepSimulationData *)0x0) &&
(*(int *)(param_1 + 0x90) != *(int *)(gpGlobals + 0x18))) {
*(int *)(param_1 + 0x90) = *(int *)(gpGlobals + 0x18);
piVar6 = (int *)&stack0xffffffb4;
if (*param_1 != (StepSimulationData)0x0) {
(**(code **)(*(int *)this + 0x2d4))();
fVar8 = *(float *)(param_1 + 0x68);
piVar6 = (int *)&stack0xffffffb0;
if (((fVar8 == local_2c) && (fVar10 = *(float *)(param_1 + 0x6c), fVar10 == local_28)) &&
(fVar11 = *(float *)(param_1 + 0x70), fVar11 == local_24)) {
iVar4 = *(int *)(param_1 + 0x24);
iVar7 = *(int *)(param_1 + 100) - iVar4;
if (iVar7 < 1) {
fVar9 = 1.0;
}
else {
fVar9 = (float)(*(int *)(gpGlobals + 0x18) - iVar4) / (float)iVar7;
if (fVar9 <= 0.0) {
fVar9 = 0.0;
}
if (1.0 <= fVar9) {
fVar9 = 1.0;
}
}
if ((*(int *)(param_1 + 4) == 0) || (iVar4 <= *(int *)(param_1 + 4))) {
*(float *)(param_1 + 0x98) =
(fVar10 - *(float *)(param_1 + 0x2c)) * fVar9 + *(float *)(param_1 + 0x2c);
*(float *)(param_1 + 0x94) =
(fVar8 - *(float *)(param_1 + 0x28)) * fVar9 + *(float *)(param_1 + 0x28);
*(float *)(param_1 + 0x9c) =
(fVar11 - *(float *)(param_1 + 0x30)) * fVar9 + *(float *)(param_1 + 0x30);
piVar6 = (int *)&stack0xffffffb0;
}
else if (*(int *)(step_spline._28_4_ + 0x30) == 0) {
iVar7 = *(int *)(param_1 + 0x44);
pSVar5 = param_1 + 0x24;
if (iVar4 < iVar7) {
if (iVar7 < *(int *)(gpGlobals + 0x18)) {
pSVar5 = param_1 + 0x44;
iVar4 = iVar7;
iVar7 = *(int *)(param_1 + 100);
}
else {
fVar8 = *(float *)(param_1 + 0x48);
fVar10 = *(float *)(param_1 + 0x4c);
fVar11 = *(float *)(param_1 + 0x50);
}
if (0 < iVar7 - iVar4) {
fVar9 = (float)(*(int *)(gpGlobals + 0x18) - iVar4) / (float)(iVar7 - iVar4);
if (fVar9 <= 0.0) {
fVar9 = 0.0;
}
if (1.0 <= fVar9) {
fVar9 = 1.0;
}
}
}
fVar1 = *(float *)(pSVar5 + 8);
fVar2 = *(float *)(pSVar5 + 0xc);
*(float *)(param_1 + 0x94) =
(fVar8 - *(float *)(pSVar5 + 4)) * fVar9 + *(float *)(pSVar5 + 4);
*(float *)(param_1 + 0x98) = (fVar10 - fVar1) * fVar9 + *(float *)(pSVar5 + 8);
*(float *)(param_1 + 0x9c) = (fVar11 - fVar2) * fVar9 + *(float *)(pSVar5 + 0xc);
piVar6 = (int *)&stack0xffffffb0;
}
else {
Hermite_Spline((Vector *)(param_1 + 8),(Vector *)(param_1 + 0x28),
(Vector *)(param_1 + 0x68),fVar9,(Vector *)(param_1 + 0x94));
piVar6 = (int *)&stack0xffffffb0;
}
}
else {
*param_1 = (StepSimulationData)0x0;
}
}
if (param_1[1] != (StepSimulationData)0x0) {
iVar4 = *(int *)this;
piVar6[1] = (int)this;
*piVar6 = (int)&local_2c;
pcVar3 = *(code **)(iVar4 + 0x2d8);
piVar6[-1] = 0x60d422;
(*pcVar3)();
if (((*(float *)(param_1 + 0x84) == local_2c) && (*(float *)(param_1 + 0x88) == local_28)) &&
(*(float *)(param_1 + 0x8c) == local_24)) {
iVar4 = *(int *)(param_1 + 0x24);
iVar7 = *(int *)(param_1 + 100) - iVar4;
if (iVar7 < 1) {
fVar8 = 1.0;
}
else {
fVar8 = (float)(*(int *)(gpGlobals + 0x18) - iVar4) / (float)iVar7;
if (fVar8 <= 0.0) {
fVar8 = 0.0;
}
if (1.0 <= fVar8) {
fVar8 = 1.0;
}
}
if ((*(int *)(param_1 + 4) == 0) || (iVar4 <= *(int *)(param_1 + 4))) {
piVar6[2] = (int)&local_2c;
*piVar6 = (int)(param_1 + 0x74);
local_30 = param_1 + 0x34;
piVar6[1] = (int)fVar8;
}
else {
if (*(int *)(step_spline._28_4_ + 0x30) != 0) {
piVar6[3] = (int)&local_2c;
piVar6[1] = (int)(param_1 + 0x74);
*piVar6 = (int)(param_1 + 0x34);
piVar6[2] = (int)fVar8;
piVar6[-1] = (int)(param_1 + 0x14);
piVar6[-2] = 0x60d769;
Hermite_Spline((Quaternion *)piVar6[-1],(Quaternion *)*piVar6,(Quaternion *)piVar6[1],
(float)piVar6[2],(Quaternion *)piVar6[3]);
*piVar6 = (int)(param_1 + 0xa0);
piVar6[-1] = (int)&local_2c;
piVar6[-2] = 0x60d775;
QuaternionAngles((Quaternion *)piVar6[-1],(QAngle *)*piVar6);
return;
}
local_30 = param_1 + 0x24;
local_34 = param_1 + 100;
iVar7 = *(int *)(param_1 + 0x44);
if (iVar4 < iVar7) {
if (iVar7 < *(int *)(gpGlobals + 0x18)) {
local_30 = param_1 + 0x44;
iVar4 = iVar7;
iVar7 = *(int *)(param_1 + 100);
}
else {
local_34 = param_1 + 0x44;
}
if (0 < iVar7 - iVar4) {
fVar8 = (float)(*(int *)(gpGlobals + 0x18) - iVar4) / (float)(iVar7 - iVar4);
if (fVar8 <= 0.0) {
fVar8 = 0.0;
}
if (1.0 <= fVar8) {
fVar8 = 1.0;
}
}
}
piVar6[2] = (int)&local_2c;
piVar6[1] = (int)fVar8;
*piVar6 = (int)(local_34 + 0x10);
local_30 = local_30 + 0x10;
}
piVar6[-1] = (int)local_30;
piVar6[-2] = 0x60d532;
QuaternionBlend((Quaternion *)piVar6[-1],(Quaternion *)*piVar6,(float)piVar6[1],
(Quaternion *)piVar6[2]);
*piVar6 = (int)(param_1 + 0xa0);
piVar6[-1] = (int)&local_2c;
piVar6[-2] = 0x60d53e;
QuaternionAngles((Quaternion *)piVar6[-1],(QAngle *)*piVar6);
return;
}
param_1[1] = (StepSimulationData)0x0;
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.