TerrorNavMesh::OnAreaCleared
0x00978930 · 1093 bytes · __thiscall
_ZN13TerrorNavMesh13OnAreaClearedEP13TerrorNavArea
Decompiled
undefined (2 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* TerrorNavMesh::OnAreaCleared(TerrorNavArea*) */
void __thiscall TerrorNavMesh::OnAreaCleared(TerrorNavMesh *this,TerrorNavArea *param_1)
{
uint *puVar1;
char cVar2;
int iVar3;
int iVar4;
int iVar5;
int *piVar6;
int iVar7;
int local_44;
TerrorNavArea *local_38;
undefined4 local_34;
undefined4 local_30;
undefined4 local_28;
undefined4 local_24;
int local_20;
local_34 = 0;
local_30 = 0;
if (_towlower == 0) {
local_20 = 0;
}
else {
(**(code **)(_towlower + 0x50))
(_towlower,&local_34,0,0,0,0,"/data/src/game/server/terror/terrornav.cpp",0x14d5,
&OnAreaCleared(TerrorNavArea*)::tm_fmt,"(%s)%s","ZOMBIE",
"TerrorNavMesh::OnAreaCleared");
local_20 = _towlower;
}
iVar5 = _DAT_0105db00;
local_28 = local_34;
local_24 = local_30;
/* try { // try from 00978a69 to 00978ac9 has its CatchHandler @ 00978d8c */
if (((_DAT_0105d154 == 0) && (DAT_0105d158 != '\0')) ||
(iVar3 = ThreadGetCurrentId(), iVar5 != iVar3)) {
iVar5 = *(int *)(ZombieBoundaryClearType._28_4_ + 0x30);
iVar3 = _DAT_0105db00;
}
else {
if ((char *)*_DAT_0105d15c != "TerrorNavMesh::OnAreaCleared") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd0e7f0,(char *)0x0,0xc0db47);
}
puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
*puVar1 = *puVar1 | 4;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
iVar5 = *(int *)(ZombieBoundaryClearType._28_4_ + 0x30);
iVar3 = _DAT_0105db00;
}
_DAT_0105db00 = iVar3;
if (iVar5 == 0) {
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar5 = ThreadGetCurrentId(), iVar3 == iVar5)) {
cVar2 = CVProfNode::ExitScope();
if (cVar2 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_20 != 0) {
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
return;
}
}
else {
if ((0.0 < *(float *)(param_1 + 0x150)) && (((byte)param_1[0x12d] & 4) == 0)) {
CUtlVector<TerrorNavArea*,CUtlMemory<TerrorNavArea*,int>>::FindAndFastRemove
((CUtlVector<TerrorNavArea*,CUtlMemory<TerrorNavArea*,int>> *)(this + 0x634),
¶m_1);
if (*(int *)(ZombieShowClear._28_4_ + 0x30) != 0) {
/* try { // try from 00978d84 to 00978d86 has its CatchHandler @ 00978da1 */
(**(code **)(*(int *)param_1 + 0x54))(param_1,100,0xff,0,0xff,0x3f800000,1);
}
local_44 = 0;
do {
iVar7 = 0;
piVar6 = *(int **)(param_1 + local_44 * 4 + 0x58);
iVar5 = *piVar6;
iVar3 = iVar5;
if (0 < iVar5) {
do {
if (iVar3 < 1) {
LAB_00978c02:
local_38 = (TerrorNavArea *)0x0;
}
else {
iVar4 = 0;
if (iVar7 == 0) {
iVar4 = 0;
}
else {
do {
iVar4 = iVar4 + 1;
if (iVar4 == iVar3) goto LAB_00978c02;
} while (iVar4 != iVar7);
}
local_38 = (TerrorNavArea *)piVar6[iVar4 * 2 + 1];
}
/* try { // try from 00978c12 to 00978cf9 has its CatchHandler @ 00978da1 */
cVar2 = TerrorNavArea::IsCleared(local_38,(CTerrorPlayer *)0x0);
if (cVar2 == '\0') {
iVar3 = *(int *)(this + 0x640);
if (iVar3 < 1) {
LAB_00978c4c:
CUtlVector<TerrorNavArea*,CUtlMemory<TerrorNavArea*,int>>::InsertBefore
((CUtlVector<TerrorNavArea*,CUtlMemory<TerrorNavArea*,int>> *)
(this + 0x634),iVar3,&local_38);
if (*(int *)(ZombieShowClear._28_4_ + 0x30) != 0) {
(**(code **)(*(int *)local_38 + 0x54))(local_38,0,0,0xff,0x80,0x3f800000,1);
}
}
else if ((TerrorNavArea *)**(int **)(this + 0x634) != local_38) {
iVar4 = 0;
do {
iVar4 = iVar4 + 1;
if (iVar4 == iVar3) goto LAB_00978c4c;
} while ((TerrorNavArea *)(*(int **)(this + 0x634))[iVar4] != local_38);
if (iVar4 < 0) goto LAB_00978c4c;
}
}
if (iVar7 + 1 == iVar5) break;
iVar7 = iVar7 + 1;
piVar6 = *(int **)(param_1 + local_44 * 4 + 0x58);
iVar3 = *piVar6;
} while( true );
}
local_44 = local_44 + 1;
} while (local_44 != 4);
}
iVar5 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar3 = ThreadGetCurrentId(), iVar5 == iVar3)) {
cVar2 = CVProfNode::ExitScope();
if (cVar2 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_20 != 0) {
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,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.