JockeyScan::operator()
0x00ab2620 · 1183 bytes · __thiscall
_ZN10JockeyScanclEP8CNavArea
Decompiled
undefined (2 params)
/* JockeyScan::TEMPNAMEPLACEHOLDERVALUE(CNavArea*) */
char __thiscall JockeyScan::operator()(JockeyScan *this,CNavArea *param_1)
{
CNavArea *this_00;
uint uVar1;
int iVar2;
CNavArea *pCVar3;
int *piVar4;
int iVar5;
CBaseEntity *this_01;
char *pcVar6;
int iVar7;
int in_GS_OFFSET;
longdouble lVar8;
float fVar9;
float fVar10;
float fVar11;
float fVar12;
char local_13d;
undefined4 local_138;
undefined4 local_134;
float local_130;
undefined **local_12c;
undefined1 local_128;
undefined1 local_127;
undefined4 local_24;
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
this_00 = *(CNavArea **)(param_1 + 0x78);
pCVar3 = (CNavArea *)(**(code **)(**(int **)this + 0x52c))(*(int **)this);
if (param_1 == pCVar3) {
LAB_00ab26a8:
local_13d = '\x01';
}
else {
piVar4 = (int *)(**(code **)(*(int *)(*(int *)this + 0x4028) + 0xc0))(*(int *)this + 0x4028);
iVar5 = TerrorNavArea::GetDoor((TerrorNavArea *)param_1);
if ((((iVar5 == 0) && ((*(uint *)(param_1 + 0x54) & 2) == 0)) &&
((*(uint *)(param_1 + 0x54) & 1) == 0)) &&
(local_13d = (**(code **)(*piVar4 + 0x150))(piVar4,param_1), local_13d != '\0')) {
if (this_00 == (CNavArea *)0x0) {
LAB_00ab280b:
iVar5 = 0;
uVar1 = *(uint *)(*(int *)this + 0x3edc);
iVar7 = 0;
do {
if ((((uVar1 == 0xffffffff) ||
((int *)(g_pEntityList + (uVar1 & 0xfff) * 0x10 + 4) == (int *)0x0)) ||
(*(uint *)(g_pEntityList + (uVar1 & 0xfff) * 0x10 + 8) != uVar1 >> 0xc)) ||
((iVar2 = *(int *)(g_pEntityList + (uVar1 & 0xfff) * 0x10 + 4), iVar2 == 0 ||
(*(int *)(iVar2 + 0x2ba0) != iVar5)))) {
iVar7 = (iVar7 + 1) -
(uint)(((int)(uint)(byte)param_1[0x7d] >> ((byte)iVar5 & 0x1f) & 1U) == 0);
}
iVar5 = iVar5 + 1;
} while (iVar5 != 4);
this_01 = (CBaseEntity *)
CDirectorTacticalServices::GetClosestSurvivor
(*(CDirectorTacticalServices **)(TheDirector + 0x628),
(Vector *)(param_1 + 0x2c),true,true);
fVar9 = 0.0;
if (this_01 != (CBaseEntity *)0x0) {
if (((byte)this_01[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(this_01);
}
fVar9 = SQRT((*(float *)(this_01 + 0x2e0) - *(float *)(param_1 + 0x2c)) *
(*(float *)(this_01 + 0x2e0) - *(float *)(param_1 + 0x2c)) +
(*(float *)(this_01 + 0x2e8) - *(float *)(param_1 + 0x34)) *
(*(float *)(this_01 + 0x2e8) - *(float *)(param_1 + 0x34)) +
(*(float *)(this_01 + 0x2e4) - *(float *)(param_1 + 0x30)) *
(*(float *)(this_01 + 0x2e4) - *(float *)(param_1 + 0x30)));
}
iVar5 = *(int *)(this + 8);
fVar9 = *(float *)(z_jockey_area_range_factor._28_4_ + 0x2c) * fVar9;
if (iVar5 != 0) {
fVar12 = *(float *)(iVar5 + 0x2c) - *(float *)(param_1 + 0x2c);
fVar10 = *(float *)(iVar5 + 0x30) - *(float *)(param_1 + 0x30);
fVar11 = *(float *)(iVar5 + 0x34) - *(float *)(param_1 + 0x34);
fVar9 = fVar9 - SQRT(fVar10 * fVar10 + fVar12 * fVar12 + fVar11 * fVar11) *
*(float *)(z_jockey_area_current_factor._28_4_ + 0x2c);
}
if (*(int *)(gpGlobals + 0x18) <= *(int *)(param_1 + 0x70)) {
fVar9 = fVar9 + *(float *)(z_jockey_area_hazard_bonus._28_4_ + 0x2c);
}
fVar9 = (float)(4 - iVar7) * *(float *)(z_jockey_area_visibility_factor._28_4_ + 0x2c) +
fVar9;
if (*(int *)(z_jockey_debug._28_4_ + 0x30) != 0) {
local_12c = &PTR_InitQuietTruncation_00c08ee8;
local_128 = 1;
local_127 = 0;
local_24 = 0;
pcVar6 = (char *)CFmtStrN<256>::sprintf((CFmtStrN<256> *)&local_12c,"%2.2f",(double)fVar9)
;
local_138 = *(undefined4 *)(param_1 + 0x2c);
local_134 = *(undefined4 *)(param_1 + 0x30);
local_130 = *(float *)(param_1 + 0x34) + 3.0;
NDebugOverlay::Text((Vector *)&local_138,pcVar6,false,3.0);
}
if (*(float *)(this + 0xc) <= fVar9 && fVar9 != *(float *)(this + 0xc)) {
*(float *)(this + 0xc) = fVar9;
*(CNavArea **)(this + 4) = param_1;
goto LAB_00ab2683;
}
goto LAB_00ab26a8;
}
lVar8 = (longdouble)CNavArea::GetZDeltaAtEdgeToArea(this_00,param_1);
fVar9 = (float)lVar8;
lVar8 = (longdouble)(**(code **)(*piVar4 + 0x130))(piVar4);
if (((fVar9 <= (float)lVar8) &&
(lVar8 = (longdouble)(**(code **)(*piVar4 + 0x134))(piVar4), fVar9 <= (float)lVar8)) &&
(uVar1 = *(uint *)(param_1 + 0x54), (uVar1 & 0x40000) == 0)) {
if ((uVar1 & 0x80) == 0) {
fVar10 = 1.0;
}
else {
fVar10 = 10.0;
}
if (param_1[0x7e] == (CNavArea)0x0) {
if (param_1[0x7d] != (CNavArea)0x0) {
fVar10 = fVar10 * 5.0;
}
}
else {
fVar10 = fVar10 * 10.0;
}
if ((param_1[0x3a] != (CNavArea)0x0) && (18.0 < (float)(byte)param_1[0x3a] + 0.0)) {
fVar10 = fVar10 * 20.0;
}
if ((uVar1 & 0x80000) != 0) {
fVar10 = fVar10 * 10.0;
}
if (0.0 <= (ABS(fVar9) + 1.0) * fVar10 + *(float *)(this_00 + 0x44)) goto LAB_00ab280b;
}
}
local_13d = '\0';
}
LAB_00ab2683:
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
return local_13d;
}
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.