RetreatPathBuilder::ComputePath
0x0095a500 · 4393 bytes · __thiscall
_ZN18RetreatPathBuilder11ComputePathEv
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* RetreatPathBuilder::ComputePath() */
CNavArea * __thiscall RetreatPathBuilder::ComputePath(RetreatPathBuilder *this)
{
uint *puVar1;
float fVar2;
float fVar3;
float fVar4;
float fVar5;
float fVar6;
float fVar7;
float fVar8;
float fVar9;
CBaseEntity CVar10;
int iVar11;
CNavArea *this_00;
undefined4 uVar12;
char cVar13;
int *piVar14;
CNavArea *pCVar15;
int iVar16;
CBaseEntity *pCVar17;
int iVar18;
int iVar19;
int iVar20;
int iVar21;
int *piVar22;
CBaseEntity *pCVar23;
int iVar24;
RetreatPathBuilder *pRVar25;
longdouble lVar26;
longdouble lVar27;
longdouble lVar28;
float fVar29;
float fVar30;
float fVar31;
float local_ac;
CNavArea *local_a8;
float local_70;
float local_6c;
float local_60;
float local_58;
undefined4 local_54;
undefined4 local_50;
undefined4 local_4c;
undefined4 local_48;
int local_44;
float local_40;
float local_3c;
float local_38;
float local_34;
float local_30;
float local_2c;
float local_28;
float local_24;
float local_20;
local_54 = 0;
local_50 = 0;
if (_towlower == 0) {
local_44 = 0;
}
else {
(**(code **)(_towlower + 0x50))
(_towlower,&local_54,0,0,0,0,
"/data/src/game/server/terror/survivorbot/survivorlegs/survivorlegsretreat.cpp",0x8d,
&ComputePath()::tm_fmt,"(%s)%s","NextBot","NavAreaBuildRetreatPath");
local_44 = _towlower;
}
iVar16 = _DAT_0105db00;
local_4c = local_54;
local_48 = local_50;
/* try { // try from 0095aa67 to 0095aac7 has its CatchHandler @ 0095b641 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar18 = ThreadGetCurrentId(), iVar16 == iVar18)) {
if ((char *)*_DAT_0105d15c != "NavAreaBuildRetreatPath") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd0b768,(char *)0x0,0xca8906);
}
puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
*puVar1 = *puVar1 | 4;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
if (*(int *)(this + 4) != 0) {
/* try { // try from 0095a5c8 to 0095aa06 has its CatchHandler @ 0095b656 */
piVar14 = (int *)(**(code **)(**(int **)this + 0xb4))(*(int **)this);
pCVar15 = (CNavArea *)(**(code **)(*piVar14 + 0x52c))(piVar14);
if (pCVar15 != (CNavArea *)0x0) {
pCVar17 = *(CBaseEntity **)(this + 0x14);
if (((byte)pCVar17[0x14d] & 8) != 0) {
/* try { // try from 0095aad7 to 0095af52 has its CatchHandler @ 0095b656 */
CBaseEntity::CalcAbsolutePosition(pCVar17);
}
iVar16 = CNavMesh::GetNearestNavArea
(TheNavMesh,(Vector *)(pCVar17 + 0x2e0),false,10000.0,false,true,false);
if (iVar16 != 0) {
*(undefined4 *)(pCVar15 + 0x78) = 0;
pCVar15[0x7c] = (CNavArea)((byte)pCVar15[0x7c] & 0xf0 | 9);
iVar16 = CNavMesh::GetNavArea(TheNavMesh,*(CBaseEntity **)(this + 0x14),1,120.0);
CNavArea::ClearSearchLists();
cVar13 = (**(code **)(**(int **)(this + 4) + 0x150))(*(int **)(this + 4),pCVar15);
if (cVar13 != '\0') {
pCVar17 = *(CBaseEntity **)(this + 0x14);
fVar29 = *(float *)(pCVar15 + 4);
fVar2 = *(float *)(pCVar15 + 8);
fVar3 = *(float *)(pCVar15 + 0x10);
fVar4 = *(float *)(pCVar15 + 0x14);
if (((byte)pCVar17[0x14d] & 8) != 0) {
/* try { // try from 0095b32d to 0095b5fe has its CatchHandler @ 0095b656 */
CBaseEntity::CalcAbsolutePosition(pCVar17);
}
cVar13 = CNavArea::Contains(pCVar15,(Vector *)(pCVar17 + 0x2e0));
if (cVar13 == '\0') {
pCVar17 = (CBaseEntity *)(**(code **)(**(int **)this + 0xb4))(*(int **)this);
if (((byte)pCVar17[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar17);
}
pCVar23 = *(CBaseEntity **)(this + 0x14);
if (((byte)pCVar23[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar23);
}
fVar30 = SQRT((*(float *)(pCVar23 + 0x2e0) - *(float *)(pCVar17 + 0x2e0)) *
(*(float *)(pCVar23 + 0x2e0) - *(float *)(pCVar17 + 0x2e0)) +
(*(float *)(pCVar23 + 0x2e8) - *(float *)(pCVar17 + 0x2e8)) *
(*(float *)(pCVar23 + 0x2e8) - *(float *)(pCVar17 + 0x2e8)) +
(*(float *)(pCVar23 + 0x2e4) - *(float *)(pCVar17 + 0x2e4)) *
(*(float *)(pCVar23 + 0x2e4) - *(float *)(pCVar17 + 0x2e4)));
if (500.0 <= fVar30) {
local_60 = 0.0;
}
else {
local_60 = (1.0 - fVar30 * 0.002) * 1000.0;
if (*(int *)(SurvivorBotDebugRetreat._28_4_ + 0x30) != 0) {
pCVar17 = *(CBaseEntity **)(this + 0x14);
if (((byte)pCVar17[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar17);
}
pCVar23 = (CBaseEntity *)(**(code **)(**(int **)this + 0xb4))(*(int **)this);
if (((byte)pCVar23[0x14d] & 8) != 0) {
/* try { // try from 0095b669 to 0095b66d has its CatchHandler @ 0095b656 */
CBaseEntity::CalcAbsolutePosition(pCVar23);
}
NDebugOverlay::Line((Vector *)(pCVar23 + 0x2e0),(Vector *)(pCVar17 + 0x2e0),0xff,0,0
,true,3.0);
}
}
}
else {
if (*(int *)(SurvivorBotDebugRetreat._28_4_ + 0x30) != 0) {
(**(code **)(*(int *)pCVar15 + 0x54))(pCVar15,0xff,0,0,0x80,0x3dcccccd,1);
}
local_60 = 1000.0;
}
*(float *)(pCVar15 + 0x44) = local_60;
if ((pCVar15[0x39] != (CNavArea)0x0) &&
(fVar29 = (((fVar4 + fVar3) - fVar29) - fVar2) * 0.5, 1.0 <= fVar29)) {
local_60 = ((float)(byte)pCVar15[0x39] * 50000.0) / fVar29 + local_60;
}
if (0.0 <= local_60) {
pCVar17 = (CBaseEntity *)(**(code **)(**(int **)this + 0xb4))(*(int **)this);
iVar18 = CBaseEntity::GetTeamNumber(pCVar17);
*(float *)(pCVar15 + 0x40) = local_60;
CNavArea::AddToOpenList(pCVar15);
piVar14 = (int *)(**(code **)(**(int **)this + 0xc0))(*(int **)this);
local_a8 = (CNavArea *)0x0;
local_ac = 0.0;
LAB_0095a7c0:
pCVar15 = CNavArea::m_openList;
if (CNavArea::m_openList != (CNavArea *)0x0) {
CNavArea::RemoveFromOpenList(CNavArea::m_openList);
iVar19 = CNavArea::m_masterMarker;
*(undefined4 *)(pCVar15 + 0x4c) = 0;
*(undefined4 *)(pCVar15 + 0x48) = 0;
*(int *)(pCVar15 + 0x3c) = iVar19;
cVar13 = CNavArea::IsBlocked(pCVar15,iVar18,false);
if ((cVar13 == '\0') &&
((iVar16 == 0 || (*(int *)(pCVar15 + 0x8c) != *(int *)(iVar16 + 0x8c))))) {
*(undefined4 *)(this + 0x31c) = 0;
piVar22 = *(int **)(pCVar15 + 0x58);
if (*piVar22 < 1) {
piVar22 = *(int **)(pCVar15 + 0x60);
iVar19 = 0;
if (*piVar22 < 1) {
piVar22 = *(int **)(pCVar15 + 100);
if (0 < *piVar22) goto LAB_0095afcf;
}
else {
LAB_0095af6d:
iVar11 = 0x40 - iVar19;
pRVar25 = this + iVar19 * 0xc + 0x1c;
iVar20 = 0;
iVar24 = iVar19 + 1;
do {
iVar19 = piVar22[iVar20 * 2 + 1];
*(int *)(pRVar25 + 8) = 2;
*(int *)(pRVar25 + 4) = 0;
*(int *)pRVar25 = iVar19;
iVar19 = iVar24 + iVar20;
iVar20 = iVar20 + 1;
*(int *)(this + 0x31c) = iVar19;
piVar22 = *(int **)(pCVar15 + 0x60);
if (*piVar22 <= iVar20) break;
pRVar25 = pRVar25 + 0xc;
} while (iVar20 != iVar11);
LAB_0095afba:
piVar22 = *(int **)(pCVar15 + 100);
if (0 < *piVar22) {
if (0x3f < iVar19) goto LAB_0095a890;
LAB_0095afcf:
iVar11 = 0x40 - iVar19;
pRVar25 = this + iVar19 * 0xc + 0x1c;
iVar20 = 0;
iVar24 = iVar19 + 1;
do {
iVar19 = piVar22[iVar20 * 2 + 1];
*(int *)(pRVar25 + 8) = 3;
*(int *)(pRVar25 + 4) = 0;
*(int *)pRVar25 = iVar19;
iVar19 = iVar24 + iVar20;
iVar20 = iVar20 + 1;
*(int *)(this + 0x31c) = iVar19;
piVar22 = *(int **)(pCVar15 + 100);
if (*piVar22 <= iVar20) break;
pRVar25 = pRVar25 + 0xc;
} while (iVar20 != iVar11);
}
}
LAB_0095b022:
piVar22 = *(int **)(pCVar15 + 0x5c);
if ((0 < *piVar22) && (iVar19 < 0x40)) {
iVar11 = 0x40 - iVar19;
pRVar25 = this + iVar19 * 0xc + 0x1c;
iVar20 = 0;
iVar24 = iVar19 + 1;
do {
iVar19 = piVar22[iVar20 * 2 + 1];
*(int *)(pRVar25 + 8) = 1;
*(int *)(pRVar25 + 4) = 0;
*(int *)pRVar25 = iVar19;
iVar19 = iVar24 + iVar20;
iVar20 = iVar20 + 1;
*(int *)(this + 0x31c) = iVar19;
piVar22 = *(int **)(pCVar15 + 0x5c);
if (*piVar22 <= iVar20) break;
pRVar25 = pRVar25 + 0xc;
} while (iVar20 != iVar11);
}
}
else {
pRVar25 = this + 0x1c;
iVar19 = 0;
do {
iVar24 = piVar22[iVar19 * 2 + 1];
iVar19 = iVar19 + 1;
*(int *)(pRVar25 + 8) = 0;
*(int *)(pRVar25 + 4) = 0;
*(int *)pRVar25 = iVar24;
*(int *)(this + 0x31c) = iVar19;
piVar22 = *(int **)(pCVar15 + 0x58);
if (*piVar22 <= iVar19) {
piVar22 = *(int **)(pCVar15 + 0x60);
if (*piVar22 < 1) goto LAB_0095afba;
if (iVar19 == 0x40) goto LAB_0095a883;
goto LAB_0095af6d;
}
pRVar25 = pRVar25 + 0xc;
} while (iVar19 != 0x40);
if (**(int **)(pCVar15 + 0x60) < 1) {
if (**(int **)(pCVar15 + 100) < 1) goto LAB_0095b022;
}
else {
LAB_0095a883:
iVar19 = 0x40;
}
}
LAB_0095a890:
iVar24 = 0;
piVar22 = *(int **)(pCVar15 + 0x68);
if (0 < *piVar22) {
do {
iVar11 = piVar22[iVar24 + 1];
iVar20 = iVar19;
if (*(int *)(iVar11 + 0x24) == 0) {
LAB_0095a8d4:
iVar21 = iVar20;
if (*(int *)(iVar11 + 0x28) == 0) goto LAB_0095a8fc;
iVar19 = iVar20;
if (iVar20 < 0x40) {
iVar21 = iVar20 + 1;
*(int *)(this + iVar20 * 0xc + 0x1c) = *(int *)(iVar11 + 0x28);
*(undefined4 *)(this + iVar20 * 0xc + 0x24) = 4;
*(int *)(this + iVar20 * 0xc + 0x20) = iVar11;
*(int *)(this + 0x31c) = iVar21;
goto LAB_0095a8fc;
}
}
else {
iVar21 = iVar19;
if (iVar19 < 0x40) {
iVar20 = iVar19 + 1;
*(int *)(this + iVar19 * 0xc + 0x1c) = *(int *)(iVar11 + 0x24);
*(undefined4 *)(this + iVar19 * 0xc + 0x24) = 4;
*(int *)(this + iVar19 * 0xc + 0x20) = iVar11;
*(int *)(this + 0x31c) = iVar20;
goto LAB_0095a8d4;
}
LAB_0095a8fc:
iVar19 = iVar21;
if ((*(int *)(iVar11 + 0x2c) != 0) && (iVar21 < 0x40)) {
iVar19 = iVar21 + 1;
*(int *)(this + iVar21 * 0xc + 0x1c) = *(int *)(iVar11 + 0x2c);
*(undefined4 *)(this + iVar21 * 0xc + 0x24) = 4;
*(int *)(this + iVar21 * 0xc + 0x20) = iVar11;
*(int *)(this + 0x31c) = iVar19;
}
}
iVar24 = iVar24 + 1;
piVar22 = *(int **)(pCVar15 + 0x68);
} while (iVar24 < *piVar22);
}
piVar22 = *(int **)(pCVar15 + 0x6c);
if (*piVar22 < 1) {
LAB_0095a9a0:
if (iVar19 < 1) goto LAB_0095a7c0;
}
else {
iVar24 = piVar22[1];
iVar11 = 0;
iVar20 = iVar19;
while (iVar20 < 0x40) {
if (*(int *)(iVar24 + 0x34) == 0) {
iVar19 = *(int *)(this + 0x31c);
if (*piVar22 <= iVar11 + 1) goto LAB_0095a9a0;
}
else {
iVar19 = iVar20 + 1;
*(int *)(this + iVar20 * 0xc + 0x1c) = *(int *)(iVar24 + 0x34);
*(undefined4 *)(this + iVar20 * 0xc + 0x24) = 5;
*(int *)(this + iVar20 * 0xc + 0x20) = iVar24;
*(int *)(this + 0x31c) = iVar19;
piVar22 = *(int **)(pCVar15 + 0x6c);
if (*piVar22 <= iVar11 + 1) goto LAB_0095a9a0;
}
iVar24 = piVar22[iVar11 + 2];
iVar11 = iVar11 + 1;
iVar20 = iVar19;
}
}
pRVar25 = this + 0x1c;
local_60 = 0.0;
do {
this_00 = *(CNavArea **)pRVar25;
if (((*(int *)(this_00 + 0x3c) != CNavArea::m_masterMarker) ||
(*(int *)(this_00 + 0x3c) == *(int *)(this_00 + 0x50))) &&
(cVar13 = (**(code **)(*piVar14 + 0x150))(piVar14,this_00), cVar13 != '\0')) {
lVar26 = (longdouble)CNavArea::GetZDeltaAtEdgeToArea(pCVar15,this_00);
lVar27 = (longdouble)(**(code **)(*piVar14 + 0x134))(piVar14);
lVar28 = (longdouble)(**(code **)(*piVar14 + 0x130))(piVar14);
if ((((float)lVar26 <= (float)lVar28 + (float)lVar27) &&
(lVar27 = (longdouble)(**(code **)(*piVar14 + 0x138))(piVar14),
-(float)lVar26 <= (float)lVar27)) &&
(-1.0 < *(float *)(pCVar15 + 0x44) || *(float *)(pCVar15 + 0x44) == -1.0)) {
fVar29 = *(float *)(this + 0x18);
pCVar17 = (CBaseEntity *)(**(code **)(**(int **)this + 0xb4))(*(int **)this);
if (((byte)pCVar17[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar17);
}
if ((*(float *)(this_00 + 0x34) - *(float *)(pCVar17 + 0x2e8)) *
(*(float *)(this_00 + 0x34) - *(float *)(pCVar17 + 0x2e8)) +
(*(float *)(this_00 + 0x30) - *(float *)(pCVar17 + 0x2e4)) *
(*(float *)(this_00 + 0x30) - *(float *)(pCVar17 + 0x2e4)) +
(*(float *)(this_00 + 0x2c) - *(float *)(pCVar17 + 0x2e0)) *
(*(float *)(this_00 + 0x2c) - *(float *)(pCVar17 + 0x2e0)) <=
fVar29 * fVar29) {
lVar26 = (longdouble)CNavArea::ComputeHeightChange(pCVar15,this_00);
piVar22 = (int *)(**(code **)(**(int **)this + 0xc0))(*(int **)this);
lVar27 = (longdouble)(**(code **)(*piVar22 + 0x134))(piVar22);
if (-(float)lVar27 <= (float)lVar26) {
iVar19 = *(int *)(pRVar25 + 4);
cVar13 = (**(code **)(**(int **)(this + 4) + 0x150))
(*(int **)(this + 4),this_00);
if (cVar13 != '\0') {
fVar29 = *(float *)(this_00 + 4);
fVar2 = *(float *)(this_00 + 0x10);
fVar3 = *(float *)(this_00 + 8);
fVar4 = *(float *)(this_00 + 0x14);
if (iVar19 == 0) {
fVar30 = *(float *)(this_00 + 0x2c);
fVar5 = *(float *)(this_00 + 0x30);
fVar31 = *(float *)(this_00 + 0x34);
fVar6 = *(float *)(pCVar15 + 0x2c);
fVar7 = *(float *)(pCVar15 + 0x30);
fVar8 = *(float *)(pCVar15 + 0x34);
lVar26 = (longdouble)CNavArea::GetZDeltaAtEdgeToArea(pCVar15,this_00);
fVar9 = (float)lVar26;
lVar26 = (longdouble)
(**(code **)(**(int **)(this + 4) + 0x134))
(*(int **)(this + 4));
if (((float)lVar26 < fVar9) ||
(lVar26 = (longdouble)
(**(code **)(**(int **)(this + 4) + 0x138))
(*(int **)(this + 4)), (float)lVar26 < -fVar9))
goto LAB_0095aa30;
fVar30 = ABS(fVar9) * 10.0 +
SQRT((fVar5 - fVar7) * (fVar5 - fVar7) +
(fVar30 - fVar6) * (fVar30 - fVar6) +
(fVar31 - fVar8) * (fVar31 - fVar8));
}
else {
fVar30 = *(float *)(iVar19 + 0x1c) * 100.0;
}
fVar5 = *(float *)(pCVar15 + 0x40);
local_6c = *(float *)(pCVar15 + 0x44);
pCVar17 = *(CBaseEntity **)(this + 0x14);
if (((byte)pCVar17[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar17);
}
CalcClosestPointOnLineSegment
((Vector *)(pCVar17 + 0x2e0),(Vector *)(this_00 + 0x2c),
(Vector *)(pCVar15 + 0x2c),(Vector *)&local_40,&local_58);
if (local_58 < 0.0) {
local_40 = *(float *)(this_00 + 0x2c);
local_3c = *(float *)(this_00 + 0x30);
local_38 = *(float *)(this_00 + 0x34);
}
else if (1.0 < local_58) {
local_40 = *(float *)(pCVar15 + 0x2c);
local_3c = *(float *)(pCVar15 + 0x30);
local_38 = *(float *)(pCVar15 + 0x34);
}
pCVar17 = *(CBaseEntity **)(this + 0x14);
if (((byte)pCVar17[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar17);
}
fVar31 = SQRT((*(float *)(pCVar17 + 0x2e4) - local_3c) *
(*(float *)(pCVar17 + 0x2e4) - local_3c) +
(*(float *)(pCVar17 + 0x2e0) - local_40) *
(*(float *)(pCVar17 + 0x2e0) - local_40) +
(*(float *)(pCVar17 + 0x2e8) - local_38) *
(*(float *)(pCVar17 + 0x2e8) - local_38));
if (fVar31 < 500.0) {
fVar31 = 1.0 - fVar31 * 0.002;
local_6c = fVar31 * 1000.0;
if (*(int *)(SurvivorBotDebugRetreat._28_4_ + 0x30) != 0) {
NDebugOverlay::HorzArrow
((Vector *)(pCVar15 + 0x2c),(Vector *)(this_00 + 0x2c),5.0
,(int)(fVar31 * 255.0),0,0,0xff,true,3.0);
pCVar17 = *(CBaseEntity **)(this + 0x14);
if (((byte)pCVar17[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar17);
}
local_34 = local_40 - *(float *)(pCVar17 + 0x2e0);
local_30 = local_3c - *(float *)(pCVar17 + 0x2e4);
local_2c = local_38 - *(float *)(pCVar17 + 0x2e8);
VectorNormalize((Vector *)&local_34);
local_28 = local_40 - local_34 * 50.0;
local_24 = local_3c - local_30 * 50.0;
local_20 = local_38 - local_2c * 50.0;
NDebugOverlay::Line((Vector *)&local_40,(Vector *)&local_28,0xff,0,0
,true,3.0);
}
}
*(float *)(this_00 + 0x44) = local_6c;
local_70 = fVar30 + fVar5 + local_6c;
if ((this_00[0x39] != (CNavArea)0x0) &&
(fVar29 = (((fVar4 + fVar2) - fVar29) - fVar3) * 0.5, 1.0 <= fVar29))
{
local_70 = ((float)(byte)this_00[0x39] * 50000.0) / fVar29 + local_70;
}
if (0.0 <= local_70) {
pCVar17 = *(CBaseEntity **)(this + 0x14);
if (((byte)pCVar17[0x14d] & 8) != 0) {
/* try { // try from 0095b104 to 0095b2f5 has its CatchHandler @ 0095b656 */
CBaseEntity::CalcAbsolutePosition(pCVar17);
}
if ((*(float *)(this_00 + 0x30) - *(float *)(pCVar17 + 0x2e4)) *
*(float *)(this + 0xc) +
(*(float *)(this_00 + 0x2c) - *(float *)(pCVar17 + 0x2e0)) *
*(float *)(this + 8) +
(*(float *)(this_00 + 0x34) - *(float *)(pCVar17 + 0x2e8)) *
*(float *)(this + 0x10) <= 0.0) {
if (*(int *)(this_00 + 0x50) == CNavArea::m_masterMarker) {
if (*(float *)(this_00 + 0x40) <= local_70) goto LAB_0095aa30;
uVar12 = *(undefined4 *)(pRVar25 + 8);
*(CNavArea **)(this_00 + 0x78) = pCVar15;
*(float *)(this_00 + 0x40) = local_70;
this_00[0x7c] =
(CNavArea)((byte)this_00[0x7c] & 0xf0 | (byte)uVar12 & 0xf);
CNavArea::UpdateOnOpenList(this_00);
pCVar17 = *(CBaseEntity **)(this + 0x14);
CVar10 = pCVar17[0x14d];
}
else {
uVar12 = *(undefined4 *)(pRVar25 + 8);
*(CNavArea **)(this_00 + 0x78) = pCVar15;
*(float *)(this_00 + 0x40) = local_70;
this_00[0x7c] =
(CNavArea)((byte)this_00[0x7c] & 0xf0 | (byte)uVar12 & 0xf);
CNavArea::AddToOpenList(this_00);
pCVar17 = *(CBaseEntity **)(this + 0x14);
CVar10 = pCVar17[0x14d];
}
if (((byte)CVar10 & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar17);
}
fVar29 = SQRT((*(float *)(this_00 + 0x30) -
*(float *)(pCVar17 + 0x2e4)) *
(*(float *)(this_00 + 0x30) -
*(float *)(pCVar17 + 0x2e4)) +
(*(float *)(this_00 + 0x2c) -
*(float *)(pCVar17 + 0x2e0)) *
(*(float *)(this_00 + 0x2c) -
*(float *)(pCVar17 + 0x2e0)) +
(*(float *)(this_00 + 0x34) -
*(float *)(pCVar17 + 0x2e8)) *
(*(float *)(this_00 + 0x34) -
*(float *)(pCVar17 + 0x2e8)));
if (local_ac < fVar29) {
local_ac = fVar29;
local_a8 = this_00;
}
}
}
}
}
}
}
}
LAB_0095aa30:
local_60 = (float)((int)local_60 + 1);
pRVar25 = pRVar25 + 0xc;
} while ((int)local_60 < *(int *)(this + 0x31c));
}
goto LAB_0095a7c0;
}
goto LAB_0095b099;
}
}
}
}
}
local_a8 = (CNavArea *)0x0;
LAB_0095b099:
iVar16 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar18 = ThreadGetCurrentId(), iVar16 == iVar18)) {
cVar13 = CVProfNode::ExitScope();
if (cVar13 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_44 != 0) {
(**(code **)(local_44 + 0x54))(local_44,local_4c,local_48,0,0,0);
}
return local_a8;
}
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.