ZombieBotVision::Update
0x00a57a60 · 1858 bytes · __thiscall
_ZN15ZombieBotVision6UpdateEv
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* ZombieBotVision::Update() */
void __thiscall ZombieBotVision::Update(ZombieBotVision *this)
{
ZombieBotVision *pZVar1;
uint *puVar2;
float fVar3;
char cVar4;
int *piVar5;
TerrorNavArea *this_00;
int *piVar6;
TerrorNavArea *pTVar7;
undefined *puVar8;
undefined4 *puVar9;
int iVar10;
uint uVar11;
int iVar12;
undefined4 uVar13;
bool bVar14;
longdouble lVar15;
ZombieBotVision *pZVar16;
int *local_64;
float local_60;
undefined4 local_54;
undefined4 local_50;
undefined4 local_4c;
undefined4 local_48;
int local_44;
undefined4 local_40;
undefined4 local_3c;
undefined4 local_38;
undefined4 local_34;
int local_30 [8];
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/zombiebot/zombiebotvision.cpp",0x47,&Update()::tm_fmt,
"(%s)%s","ZOMBIE","ZombieBotVision::Update");
local_44 = _towlower;
}
iVar12 = _DAT_0105db00;
local_4c = local_54;
local_48 = local_50;
/* try { // try from 00a57ec6 to 00a57f26 has its CatchHandler @ 00a581c8 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar10 = ThreadGetCurrentId(), iVar12 == iVar10)) {
if ((char *)*_DAT_0105d15c != "ZombieBotVision::Update") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd28c28,(char *)0x0,0xc0db47);
}
puVar2 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
*puVar2 = *puVar2 | 4;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
iVar12 = *(int *)(NextBotBlind._28_4_ + 0x30);
/* try { // try from 00a57b24 to 00a57bda has its CatchHandler @ 00a581a7 */
piVar5 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
piVar5 = (int *)(**(code **)(*piVar5 + 0xb4))(piVar5);
if (((piVar5 == (int *)0x0) || (cVar4 = (**(code **)(*piVar5 + 0x16c))(piVar5), cVar4 == '\0')) ||
((*(byte *)(piVar5 + 0x1001) & 1) == 0)) {
bVar14 = iVar12 != 0;
}
else {
bVar14 = true;
}
pZVar1 = this + 0x150;
pZVar16 = pZVar1;
lVar15 = (longdouble)CountdownTimer::Now();
iVar12 = _DAT_0105db00;
if (((float)lVar15 < *(float *)(this + 0x158)) || (bVar14)) {
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar10 = ThreadGetCurrentId(pZVar16), iVar12 == iVar10)) {
cVar4 = CVProfNode::ExitScope();
if (cVar4 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_44 == 0) {
return;
}
(**(code **)(local_44 + 0x54))(local_44,local_4c,local_48,0,0,0);
return;
}
piVar5 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
piVar5 = (int *)(**(code **)(*piVar5 + 0xc4))(piVar5);
cVar4 = (**(code **)(*piVar5 + 0x114))(piVar5,0);
if (cVar4 == '\0') {
/* try { // try from 00a5806f to 00a580c6 has its CatchHandler @ 00a581a7 */
lVar15 = (longdouble)RandomFloat(0x3f800000,0x40000000);
local_60 = (float)lVar15;
lVar15 = (longdouble)CountdownTimer::Now();
if ((float)lVar15 + local_60 != *(float *)(this + 0x158)) {
(**(code **)(*(int *)(this + 0x150) + 4))(pZVar1,this + 0x158);
*(float *)(this + 0x158) = (float)lVar15 + local_60;
}
if (local_60 != *(float *)(this + 0x154)) goto LAB_00a580b1;
}
else {
lVar15 = (longdouble)(**(code **)(*(int *)this + 0xcc))(this);
local_60 = (float)lVar15 * 0.5;
lVar15 = (longdouble)CountdownTimer::Now();
if ((float)lVar15 + local_60 != *(float *)(this + 0x158)) {
/* try { // try from 00a58126 to 00a58149 has its CatchHandler @ 00a581a7 */
(**(code **)(*(int *)(this + 0x150) + 4))(pZVar1,this + 0x158);
*(float *)(this + 0x158) = (float)lVar15 + local_60;
}
if (local_60 != *(float *)(this + 0x154)) {
LAB_00a580b1:
(**(code **)(*(int *)(this + 0x150) + 4))(pZVar1,this + 0x154);
*(float *)(this + 0x154) = local_60;
}
}
local_30[0] = 0;
local_30[1] = 0;
local_30[2] = 0;
local_30[3] = 0;
local_30[4] = 0;
local_40 = 2;
local_3c = 2;
local_38 = 3;
local_34 = 9;
/* try { // try from 00a57c52 to 00a57e3e has its CatchHandler @ 00a581cc */
ForEachSurvivor<PlayerCollector>((PlayerCollector *)&local_40);
*(undefined4 *)(this + 0x14c) = 0x51ba43b7;
piVar5 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
piVar5 = (int *)(**(code **)(*piVar5 + 0xb4))(piVar5);
this_00 = (TerrorNavArea *)(**(code **)(*piVar5 + 0x52c))(piVar5);
if (local_30[3] < 1) {
LAB_00a581f0:
uVar11 = *(uint *)(this + 0x148);
if (uVar11 == 0xffffffff) goto LAB_00a57e3f;
local_64 = (int *)0x0;
LAB_00a57d95:
puVar8 = g_pEntityList + (uVar11 & 0xfff) * 0x10;
if (puVar8 == (undefined *)0xfffffffc) {
uVar13 = 0;
if (local_64 == (int *)0x0) goto LAB_00a57e3f;
}
else {
if (*(uint *)(puVar8 + 8) == uVar11 >> 0xc) {
piVar5 = *(int **)(puVar8 + 4);
}
else {
piVar5 = (int *)0x0;
}
if (local_64 == piVar5) goto LAB_00a57e3f;
if (*(uint *)(puVar8 + 8) == uVar11 >> 0xc) {
uVar13 = *(undefined4 *)(puVar8 + 4);
}
else {
uVar13 = 0;
}
}
if (local_64 != (int *)0x0) goto LAB_00a57dda;
*(undefined4 *)(this + 0x148) = 0xffffffff;
}
else {
iVar12 = 0;
local_64 = (int *)0x0;
do {
while( true ) {
piVar5 = *(int **)(local_30[0] + iVar12 * 4);
cVar4 = (**(code **)(*(int *)this + 0xdc))(this,piVar5);
if (cVar4 == '\0') break;
LAB_00a57ca0:
iVar12 = iVar12 + 1;
if (local_30[3] <= iVar12) goto LAB_00a57d50;
}
piVar6 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
lVar15 = (longdouble)(**(code **)(*piVar6 + 300))(piVar6,piVar5);
fVar3 = (float)lVar15;
/* try { // try from 00a57fdd to 00a57fe1 has its CatchHandler @ 00a581cc */
if (((*(float *)(this + 0x14c) <= fVar3) ||
((((pTVar7 = (TerrorNavArea *)(**(code **)(*piVar5 + 0x52c))(piVar5),
pTVar7 != (TerrorNavArea *)0x0 && (this_00 != (TerrorNavArea *)0x0)) &&
(cVar4 = TerrorNavArea::IsPotentiallyVisible(this_00,pTVar7,false), cVar4 == '\0')) &&
(40000.0 <= fVar3)))) ||
(cVar4 = (**(code **)(*(int *)this + 0xd0))(this,piVar5,0,0), cVar4 == '\0'))
goto LAB_00a57ca0;
iVar12 = iVar12 + 1;
*(float *)(this + 0x14c) = fVar3;
local_64 = piVar5;
} while (iVar12 < local_30[3]);
LAB_00a57d50:
if (local_64 == (int *)0x0) goto LAB_00a581f0;
lVar15 = (longdouble)IntervalTimer::Now();
if ((float)lVar15 != *(float *)(this + 0x160)) {
/* try { // try from 00a58177 to 00a58179 has its CatchHandler @ 00a581cc */
(**(code **)(*(int *)(this + 0x15c) + 4))(this + 0x15c,this + 0x160);
*(float *)(this + 0x160) = (float)lVar15;
}
uVar11 = *(uint *)(this + 0x148);
if (uVar11 != 0xffffffff) goto LAB_00a57d95;
uVar13 = 0;
LAB_00a57dda:
puVar9 = (undefined4 *)(**(code **)(*local_64 + 0xc))(local_64);
*(undefined4 *)(this + 0x148) = *puVar9;
}
piVar5 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
(**(code **)(*piVar5 + 0x54))(piVar5,uVar13);
if (local_64 != (int *)0x0) {
piVar5 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
(**(code **)(*piVar5 + 0x50))(piVar5,local_64);
}
piVar5 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
(**(code **)(*piVar5 + 0x58))(piVar5,local_64);
LAB_00a57e3f:
local_30[3] = 0;
CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)local_30);
local_30[4] = local_30[0];
CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)local_30);
iVar12 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar10 = ThreadGetCurrentId(), iVar12 == iVar10)) {
cVar4 = CVProfNode::ExitScope();
if (cVar4 != '\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;
}
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.