InfectedAmbientMobPathCost::operator()
0x00a27900 · 457 bytes · __thiscall
_ZNK26InfectedAmbientMobPathCostclEP8CNavAreaS1_PK10CNavLadderPK13CFuncElevatorf
Decompiled
undefined (6 params)
/* InfectedAmbientMobPathCost::TEMPNAMEPLACEHOLDERVALUE(CNavArea*, CNavArea*, CNavLadder const*,
CFuncElevator const*, float) const */
longdouble __thiscall
InfectedAmbientMobPathCost::operator()
(InfectedAmbientMobPathCost *this,CNavArea *param_1,CNavArea *param_2,CNavLadder *param_3,
CFuncElevator *param_4,float param_5)
{
float fVar1;
char cVar2;
longdouble lVar3;
float fVar4;
float fVar5;
float fVar6;
float local_28;
cVar2 = (**(code **)(**(int **)(this + 0xc) + 0x150))(*(int **)(this + 0xc),param_1);
local_28 = -1.0;
if (cVar2 != '\0') {
if (param_2 == (CNavArea *)0x0) {
local_28 = 0.0;
}
else {
fVar4 = *(float *)(this + 0x10);
if (param_3 == (CNavLadder *)0x0) {
local_28 = -1.0;
lVar3 = (longdouble)CNavArea::GetZDeltaAtEdgeToArea(param_2,param_1);
fVar1 = (float)lVar3;
lVar3 = (longdouble)(**(code **)(**(int **)(this + 0xc) + 0x134))(*(int **)(this + 0xc));
if ((float)lVar3 < fVar1) goto LAB_00a2799c;
fVar5 = 1.0;
if (param_5 <= 0.0) {
param_5 = SQRT((*(float *)(param_1 + 0x30) - *(float *)(param_2 + 0x30)) *
(*(float *)(param_1 + 0x30) - *(float *)(param_2 + 0x30)) +
(*(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)));
}
fVar6 = 0.0;
if (0.0 <= fVar1) {
fVar6 = fVar1;
}
if (24.0 <= fVar6) {
fVar5 = (1.0 - fVar4) * 3.0 + 1.0;
}
if (3.0 < ABS(fVar6 * fVar5)) {
param_5 = ABS(fVar6 * fVar5) + param_5;
}
if (((byte)param_1[0x56] & 8) != 0) {
param_5 = param_5 * 10.0;
}
}
else {
fVar4 = ((1.0 - fVar4) + 1.0) * 5.0;
if (*(float *)(param_1 + 0x34) <= *(float *)(param_2 + 0x34) &&
*(float *)(param_2 + 0x34) != *(float *)(param_1 + 0x34)) {
fVar4 = fVar4 * 3.0;
}
param_5 = fVar4 * *(float *)(param_3 + 0x1c);
}
lVar3 = (longdouble)RandomFloat(0x3f4ccccd,0x3f99999a);
local_28 = (float)lVar3 * param_5 + *(float *)(param_2 + 0x44);
}
}
LAB_00a2799c:
return (longdouble)local_28;
}
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.