IVision::UpdateRecognizedSet
0x0075cad0 · 2875 bytes · __thiscall
_ZN7IVision19UpdateRecognizedSetEv
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* IVision::UpdateRecognizedSet() */
void __thiscall IVision::UpdateRecognizedSet(IVision *this)
{
char cVar1;
uint uVar2;
int *piVar3;
int *piVar4;
uint *puVar5;
INextBot *this_00;
undefined4 uVar6;
undefined4 *puVar7;
size_t __size;
int iVar8;
undefined *puVar9;
int iVar10;
int iVar11;
int iVar12;
CBaseEntity *this_01;
undefined1 *puVar13;
CBaseEntity *pCVar14;
int iVar15;
int in_GS_OFFSET;
longdouble lVar16;
float fVar17;
CUtlMemory<CBaseCombatCharacter*,int> *this_02;
int local_80;
int local_74;
undefined4 local_64;
undefined4 local_60;
undefined4 local_5c;
undefined4 local_58;
CUtlMemory<CBaseCombatCharacter*,int> *local_54;
undefined4 local_50;
undefined4 local_4c;
undefined4 local_48;
undefined4 local_44;
float local_40;
IVision *local_3c;
void *local_38;
int local_34;
int local_30;
int local_2c;
void *local_28;
Color local_24;
undefined1 local_23;
undefined1 local_22;
undefined1 local_21;
int local_20;
local_64 = 0;
local_60 = 0;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (_towlower == (CUtlMemory<CBaseCombatCharacter*,int> *)0x0) {
local_54 = (CUtlMemory<CBaseCombatCharacter*,int> *)0x0;
}
else {
(**(code **)(_towlower + 0x50))
(_towlower,&local_64,0,0,0,0,
"/data/src/game/server/nextbot/nextbotvisioninterface.cpp",0x110,
&UpdateRecognizedSet()::tm_fmt,"(%s)%s","NextBot","IVision::UpdateRecognizedSet");
local_54 = _towlower;
}
iVar12 = _DAT_0105db00;
local_5c = local_64;
local_58 = local_60;
/* try { // try from 0075cd53 to 0075cdb3 has its CatchHandler @ 0075d575 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar8 = ThreadGetCurrentId(), iVar12 == iVar8)) {
if (*(char **)_DAT_0105d15c != "IVision::UpdateRecognizedSet") {
_DAT_0105d15c =
(CUtlMemory<CBaseCombatCharacter*,int> *)
CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xcaa199,(char *)0x0,0xca8906);
}
puVar5 = (uint *)(_DAT_0105d1e8 + 4 + *(int *)(_DAT_0105d15c + 0x70) * 8);
*puVar5 = *puVar5 | 4;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
local_28 = (void *)0x0;
iVar12 = 1;
local_38 = (void *)0x0;
local_34 = 0;
local_30 = 0;
local_3c = this;
local_2c = 0;
if (0 < *(int *)(gpGlobals + 0x14)) {
LAB_0075cc15:
do {
piVar3 = (int *)UTIL_PlayerByIndex(iVar12);
if ((piVar3 != (int *)0x0) && (piVar3[0xc] != 0)) {
if (piVar3[0xc] - *(int *)(gpGlobals + 0x58) >> 4 == 0) {
iVar12 = iVar12 + 1;
if (*(int *)(gpGlobals + 0x14) < iVar12) break;
goto LAB_0075cc15;
}
/* try { // try from 0075cbdd to 0075cd07 has its CatchHandler @ 0075d58a */
cVar1 = (**(code **)(*piVar3 + 0x16c))(piVar3);
if (((cVar1 != '\0') && (piVar3[0x7db] != 2)) &&
((iVar8 = (**(code **)(*piVar3 + 0x148))(piVar3), iVar8 == 0 &&
(((cVar1 = (**(code **)(*(int *)local_3c + 0xdc))(local_3c,piVar3), cVar1 == '\0' &&
(cVar1 = (**(code **)(*piVar3 + 300))(piVar3), cVar1 != '\0')) &&
(cVar1 = (**(code **)(*piVar3 + 0x558))(piVar3), cVar1 == '\0')))))) {
piVar4 = (int *)(**(code **)(*(int *)local_3c + 0xb0))(local_3c);
piVar4 = (int *)(**(code **)(*piVar4 + 0xb4))(piVar4);
if ((piVar3 != piVar4) &&
(cVar1 = (**(code **)(*(int *)local_3c + 0xd0))(local_3c,piVar3,0), iVar8 = local_2c,
cVar1 != '\0')) {
iVar10 = local_2c + 1;
if ((local_34 < iVar10) && (-1 < local_30)) {
if (local_30 == 0) {
if (local_34 == 0) {
if (iVar10 < 9) {
local_34 = 8;
goto LAB_0075d602;
}
local_34 = 8;
}
do {
local_34 = local_34 * 2;
} while (local_34 < iVar10);
}
else {
for (local_34 = (local_2c / local_30 + 1) * local_30;
(local_34 < iVar10 && (local_34 = (local_34 + iVar10) / 2, local_34 < iVar10));
local_34 = (local_34 + iVar10) / 2) {
}
}
LAB_0075d602:
if (local_38 == (void *)0x0) {
local_38 = malloc(local_34 << 2);
}
else {
local_38 = realloc(local_38,local_34 << 2);
iVar10 = local_2c + 1;
}
}
iVar15 = iVar8 << 2;
iVar11 = (iVar10 - iVar8) + -1;
local_2c = iVar10;
local_28 = local_38;
if (0 < iVar11) {
iVar15 = iVar8 * 4;
/* try { // try from 0075d5d5 to 0075d5d9 has its CatchHandler @ 0075d58a */
_V_memmove((void *)((int)local_38 + iVar15 + 4),(void *)((int)local_38 + iVar15),
iVar11 * 4);
}
if ((undefined4 *)((int)local_38 + iVar15) != (undefined4 *)0x0) {
*(undefined4 *)((int)local_38 + iVar15) = piVar3;
}
}
}
}
iVar12 = iVar12 + 1;
} while (iVar12 <= *(int *)(gpGlobals + 0x14));
}
iVar12 = TheNextBots();
uVar2 = (uint)*(ushort *)(iVar12 + 0x10);
if (uVar2 != 0xffff) {
iVar8 = *(int *)(iVar12 + 4);
do {
piVar3 = *(int **)(iVar8 + uVar2 * 8);
piVar3 = (int *)(**(code **)(*piVar3 + 0xb4))(piVar3);
cVar1 = (**(code **)(*(int *)local_3c + 0xdc))(local_3c,piVar3);
if (((cVar1 == '\0') && (cVar1 = (**(code **)(*piVar3 + 300))(piVar3), cVar1 != '\0')) &&
(cVar1 = (**(code **)(*piVar3 + 0x558))(piVar3), cVar1 == '\0')) {
piVar4 = (int *)(**(code **)(*(int *)local_3c + 0xb0))(local_3c);
piVar4 = (int *)(**(code **)(*piVar4 + 0xb4))(piVar4);
if ((piVar3 != piVar4) &&
(cVar1 = (**(code **)(*(int *)local_3c + 0xd0))(local_3c,piVar3,0), iVar8 = local_2c,
cVar1 != '\0')) {
iVar10 = local_2c + 1;
if ((local_34 < iVar10) && (-1 < local_30)) {
if (local_30 == 0) {
if ((local_34 == 0) && (local_34 = 8, iVar10 < 9)) goto LAB_0075d41e;
do {
iVar11 = local_34;
local_34 = iVar11 * 2;
} while (local_34 < iVar10);
__size = iVar11 << 3;
}
else {
for (local_34 = (local_2c / local_30 + 1) * local_30; local_34 < iVar10;
local_34 = (local_34 + iVar10) / 2) {
}
LAB_0075d41e:
__size = local_34 << 2;
}
if (local_38 == (void *)0x0) {
local_38 = malloc(__size);
}
else {
local_38 = realloc(local_38,__size);
iVar10 = local_2c + 1;
}
}
iVar11 = (iVar10 - iVar8) + -1;
iVar8 = iVar8 * 4;
local_2c = iVar10;
local_28 = local_38;
if (0 < iVar11) {
_V_memmove((void *)((int)local_38 + iVar8 + 4),(void *)((int)local_38 + iVar8),
iVar11 * 4);
}
if ((undefined4 *)((int)local_38 + iVar8) != (undefined4 *)0x0) {
*(undefined4 *)((int)local_38 + iVar8) = piVar3;
}
}
}
iVar8 = *(int *)(iVar12 + 4);
uVar2 = (uint)*(ushort *)(iVar8 + 6 + uVar2 * 8);
} while (uVar2 != 0xffff);
}
if (0 < *(int *)(this + 0x38)) {
local_74 = 0;
do {
while( true ) {
puVar5 = (uint *)(local_74 * 0x14 + *(int *)(this + 0x2c));
uVar2 = *puVar5;
if ((((uVar2 != 0xffffffff) &&
(puVar9 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc))
&& (*(uint *)(puVar9 + 8) == uVar2 >> 0xc)) &&
(pCVar14 = *(CBaseEntity **)(puVar9 + 4), pCVar14 != (CBaseEntity *)0x0)) break;
LAB_0075cde8:
/* try { // try from 0075ce00 to 0075ce04 has its CatchHandler @ 0075d58a */
CUtlVector<IVision::RecognizeInfo,CUtlMemory<IVision::RecognizeInfo,int>>::ShiftElementsLeft
((CUtlVector<IVision::RecognizeInfo,CUtlMemory<IVision::RecognizeInfo,int>> *)
(this + 0x2c),local_74,1);
local_74 = local_74 + -1;
iVar12 = *(int *)(this + 0x38) + -1;
*(int *)(this + 0x38) = iVar12;
LAB_0075ce18:
local_74 = local_74 + 1;
if (iVar12 <= local_74) goto LAB_0075cf09;
}
if (0 < local_2c) {
iVar12 = 0;
do {
if (*(int *)(pCVar14 + 0x30) == 0) {
iVar8 = 0;
}
else {
iVar8 = *(int *)(pCVar14 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
iVar10 = *(int *)(*(int *)((int)local_38 + iVar12 * 4) + 0x30);
if (iVar10 == 0) {
iVar10 = 0;
}
else {
iVar10 = iVar10 - *(int *)(gpGlobals + 0x58) >> 4;
}
if (iVar8 == iVar10) {
if (((byte)pCVar14[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar14);
puVar5 = (uint *)(local_74 * 0x14 + *(int *)(this + 0x2c));
}
puVar9 = g_pEntityList;
this_01 = (CBaseEntity *)0x0;
puVar5[1] = *(uint *)(pCVar14 + 0x2e0);
puVar5[2] = *(uint *)(pCVar14 + 0x2e4);
puVar5[3] = *(uint *)(pCVar14 + 0x2e8);
uVar2 = *(uint *)(*(int *)(this + 0x2c) + local_74 * 0x14);
if (((uVar2 != 0xffffffff) &&
(puVar9 = puVar9 + (uVar2 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar9 + 8) == uVar2 >> 0xc)) {
this_01 = *(CBaseEntity **)(puVar9 + 4);
}
/* try { // try from 0075d0d0 to 0075d29a has its CatchHandler @ 0075d58a */
iVar12 = CBaseEntity::GetTeamNumber(this_01);
iVar12 = iVar12 * 8;
lVar16 = (longdouble)IntervalTimer::Now();
if ((float)lVar16 == *(float *)(this + iVar12 + 0x4c)) {
iVar12 = *(int *)(this + 0x38);
}
else {
(**(code **)(*(int *)(this + iVar12 + 0x48) + 4))
(this + iVar12 + 0x48,this + iVar12 + 0x4c);
*(float *)(this + iVar12 + 0x4c) = (float)lVar16;
iVar12 = *(int *)(this + 0x38);
}
goto LAB_0075ce18;
}
iVar12 = iVar12 + 1;
} while (iVar12 != local_2c);
}
fVar17 = *(float *)(gpGlobals + 0xc) - 0.5;
if ((float)puVar5[4] <= fVar17 && fVar17 != (float)puVar5[4]) {
this_00 = (INextBot *)(**(code **)(*(int *)this + 0xb0))(this);
cVar1 = INextBot::IsDebugging(this_00,0x20);
if (cVar1 != '\0') {
uVar2 = *(uint *)(*(int *)(this + 0x2c) + local_74 * 0x14);
if (((uVar2 == 0xffffffff) ||
(puVar9 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc))
|| (*(uint *)(puVar9 + 8) != uVar2 >> 0xc)) {
iVar12 = _DAT_00000030;
if (_DAT_00000030 != 0) goto LAB_0075d1b1;
LAB_0075d3d4:
iVar12 = 0;
}
else {
iVar12 = *(int *)(*(int *)(puVar9 + 4) + 0x30);
if (iVar12 == 0) goto LAB_0075d3d4;
LAB_0075d1b1:
iVar12 = iVar12 - *(int *)(gpGlobals + 0x58) >> 4;
}
iVar8 = 0;
if (((uVar2 != 0xffffffff) &&
(puVar9 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc))
&& (*(uint *)(puVar9 + 8) == uVar2 >> 0xc)) {
iVar8 = *(int *)(puVar9 + 4);
}
puVar13 = &DAT_00d539c2;
if (*(undefined1 **)(iVar8 + 0x7c) != (undefined1 *)0x0) {
puVar13 = *(undefined1 **)(iVar8 + 0x7c);
}
piVar3 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
uVar6 = (**(code **)(*piVar3 + 0x13c))(piVar3);
local_24 = 0xff;
local_23 = 0;
local_22 = 0;
local_21 = 0xff;
ConColorMsg(&local_24,"%3.2f: %s Lost sight of %s(#%d)\n",
(double)*(float *)(gpGlobals + 0xc),uVar6,puVar13,iVar12);
}
piVar3 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
uVar6 = 0;
uVar2 = *(uint *)(*(int *)(this + 0x2c) + local_74 * 0x14);
if (((uVar2 != 0xffffffff) &&
(puVar9 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar9 + 8) == uVar2 >> 0xc)) {
uVar6 = *(undefined4 *)(puVar9 + 4);
}
(**(code **)(*piVar3 + 0x54))(piVar3,uVar6);
goto LAB_0075cde8;
}
local_74 = local_74 + 1;
} while (local_74 < *(int *)(this + 0x38));
}
LAB_0075cf09:
if (0 < local_2c) {
local_80 = 0;
do {
while( true ) {
iVar12 = *(int *)(this + 0x38);
if (iVar12 < 1) break;
iVar10 = 0;
puVar5 = *(uint **)(this + 0x2c);
iVar8 = *(int *)((int)local_38 + local_80 * 4);
do {
uVar2 = *puVar5;
if (((uVar2 == 0xffffffff) ||
(puVar9 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc))
|| (*(uint *)(puVar9 + 8) != uVar2 >> 0xc)) {
if (iVar8 == 0) goto LAB_0075cfa8;
}
else if (*(int *)(puVar9 + 4) == iVar8) goto LAB_0075cfa8;
iVar10 = iVar10 + 1;
puVar5 = puVar5 + 5;
} while (iVar10 != iVar12);
LAB_0075d300:
local_50 = 0xffffffff;
piVar3 = *(int **)((int)local_38 + local_80 * 4);
pCVar14 = (CBaseEntity *)0x0;
if (piVar3 != (int *)0x0) {
/* try { // try from 0075d320 to 0075d523 has its CatchHandler @ 0075d58a */
puVar7 = (undefined4 *)(**(code **)(*piVar3 + 0xc))(piVar3);
local_50 = *puVar7;
pCVar14 = *(CBaseEntity **)((int)local_38 + local_80 * 4);
}
if (((byte)pCVar14[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar14);
}
local_4c = *(undefined4 *)(pCVar14 + 0x2e0);
local_48 = *(undefined4 *)(pCVar14 + 0x2e4);
local_44 = *(undefined4 *)(pCVar14 + 0x2e8);
fVar17 = *(float *)(gpGlobals + 0xc);
lVar16 = (longdouble)(**(code **)(*(int *)this + 0xcc))(this);
local_40 = (float)lVar16 + fVar17;
CUtlVector<IVision::RecognizeInfo,CUtlMemory<IVision::RecognizeInfo,int>>::InsertBefore
((CUtlVector<IVision::RecognizeInfo,CUtlMemory<IVision::RecognizeInfo,int>> *)
(this + 0x2c),*(int *)(this + 0x38),(RecognizeInfo *)&local_50);
local_80 = local_80 + 1;
if (local_2c <= local_80) goto LAB_0075cfb8;
}
if (iVar12 == 0) goto LAB_0075d300;
LAB_0075cfa8:
local_80 = local_80 + 1;
} while (local_80 < local_2c);
}
LAB_0075cfb8:
this_02 = (CUtlMemory<CBaseCombatCharacter*,int> *)&local_38;
local_2c = 0;
CUtlMemory<CBaseCombatCharacter*,int>::Purge(this_02);
local_28 = local_38;
CUtlMemory<CBaseCombatCharacter*,int>::Purge(this_02);
iVar12 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar8 = ThreadGetCurrentId(), iVar12 == iVar8)) {
this_02 = _DAT_0105d15c;
cVar1 = CVProfNode::ExitScope();
if (cVar1 != '\0') {
_DAT_0105d15c = *(CUtlMemory<CBaseCombatCharacter*,int> **)(_DAT_0105d15c + 100);
}
DAT_0105d158 = _DAT_0105d15c == (CUtlMemory<CBaseCombatCharacter*,int> *)0x105d160;
}
if (local_54 != (CUtlMemory<CBaseCombatCharacter*,int> *)0x0) {
this_02 = local_54;
(**(code **)(local_54 + 0x54))(local_54,local_5c,local_58,0,0,0);
}
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail(this_02);
}
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.