InfectedPathCost::operator()
0x00a17650 · 752 bytes · __thiscall
_ZNK16InfectedPathCostclEP8CNavAreaS1_PK10CNavLadderPK13CFuncElevatorf
Decompiled
undefined (6 params)
/* InfectedPathCost::TEMPNAMEPLACEHOLDERVALUE(CNavArea*, CNavArea*, CNavLadder const*, CFuncElevator
const*, float) const */
longdouble __thiscall
InfectedPathCost::operator()
(InfectedPathCost *this,CNavArea *param_1,CNavArea *param_2,CNavLadder *param_3,
CFuncElevator *param_4,float param_5)
{
float fVar1;
float fVar2;
float fVar3;
float fVar4;
char cVar5;
uint uVar6;
longdouble lVar7;
float fVar8;
float fVar9;
float fVar10;
float fVar11;
float local_20 [4];
cVar5 = (**(code **)(**(int **)(this + 0xc) + 0x150))(*(int **)(this + 0xc),param_1);
if (cVar5 == '\0') {
return -(longdouble)1;
}
fVar8 = *(float *)(param_1 + 4);
fVar1 = *(float *)(param_1 + 0x10);
fVar2 = *(float *)(param_1 + 8);
fVar3 = *(float *)(param_1 + 0x14);
if (param_2 == (CNavArea *)0x0) {
return (longdouble)0;
}
fVar10 = *(float *)(this + 0x10);
if (param_3 == (CNavLadder *)0x0) {
lVar7 = (longdouble)CNavArea::GetZDeltaAtEdgeToArea(param_2,param_1);
fVar4 = (float)lVar7;
lVar7 = (longdouble)(**(code **)(**(int **)(this + 0xc) + 0x134))(*(int **)(this + 0xc));
if ((float)lVar7 < fVar4) {
LAB_00a178a0:
return -(longdouble)1;
}
if (param_5 <= 0.0) {
param_5 = SQRT((*(float *)(param_1 + 0x34) - *(float *)(param_2 + 0x34)) *
(*(float *)(param_1 + 0x34) - *(float *)(param_2 + 0x34)) +
(*(float *)(param_1 + 0x2c) - *(float *)(param_2 + 0x2c)) *
(*(float *)(param_1 + 0x2c) - *(float *)(param_2 + 0x2c)) +
(*(float *)(param_1 + 0x30) - *(float *)(param_2 + 0x30)) *
(*(float *)(param_1 + 0x30) - *(float *)(param_2 + 0x30)));
}
fVar11 = 1.0;
if (*(int *)(this + 0x14) == 1) {
if (fVar4 < 0.0) {
fVar10 = fVar4 + fVar4;
}
else {
fVar10 = 0.0;
if (fVar4 <= 0.0) {
fVar10 = fVar4;
}
}
}
else {
fVar9 = 0.0;
if (0.0 <= fVar4) {
fVar9 = fVar4;
}
if (24.0 <= fVar9) {
fVar11 = (1.0 - fVar10) * 3.0 + 1.0;
}
fVar10 = fVar9 * fVar11;
}
local_20[0] = param_5;
if (3.0 < ABS(fVar10)) {
local_20[0] = ABS(fVar10) + param_5;
}
if (*(int *)(this + 8) == 0) {
uVar6 = *(uint *)(param_1 + 0x54);
}
else {
(**(code **)(operator()(CNavArea*,CNavArea*,CNavLadder_const*,CFuncElevator_const*,float)::
hideDesire + *(int *)(this + 0x14) * 4))(local_20,param_1);
uVar6 = *(uint *)(param_1 + 0x54);
if ((*(int *)(this + 8) != 0) && ((uVar6 & 1) != 0)) goto LAB_00a178a0;
}
if ((uVar6 & 0x80000) != 0) {
local_20[0] = local_20[0] * 10.0;
}
}
else {
local_20[0] = ((1.0 - fVar10) + 1.0) * 5.0;
if (*(float *)(param_2 + 0x34) < *(float *)(param_1 + 0x34) ||
*(float *)(param_2 + 0x34) == *(float *)(param_1 + 0x34)) {
if (*(int *)(this + 0x14) == 1) {
local_20[0] = 1.0;
}
}
else {
local_20[0] = local_20[0] * 3.0;
}
local_20[0] = local_20[0] * *(float *)(param_3 + 0x1c);
}
lVar7 = (longdouble)(local_20[0] + *(float *)(param_2 + 0x44));
if ((param_1[0x39] != (CNavArea)0x0) &&
(fVar8 = (((fVar1 + fVar3) - fVar8) - fVar2) * 0.5, 1.0 <= fVar8)) {
lVar7 = (longdouble)
(local_20[0] + *(float *)(param_2 + 0x44) +
((float)(byte)param_1[0x39] * 50000.0) / fVar8);
}
return lVar7;
}
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.