z_debug_path_stress_test
0x00a13740 · 2774 bytes · __cdecl
_ZL24z_debug_path_stress_testRK8CCommand
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* z_debug_path_stress_test(CCommand const&) */
void z_debug_path_stress_test(CCommand *param_1)
{
uint *puVar1;
undefined4 uVar2;
CNavArea CVar3;
char cVar4;
int iVar5;
INextBot *pIVar6;
CBaseEntity *pCVar7;
int iVar8;
Vector *pVVar9;
Path *this;
CNavArea *pCVar10;
char *this_00;
CNavArea *pCVar11;
float *pfVar12;
longdouble lVar13;
INextBot *pIVar14;
undefined4 uVar15;
undefined4 uVar16;
undefined4 uVar17;
undefined4 uVar18;
int local_4804;
int local_47f8;
int local_47f4;
CNavArea *local_47e0;
undefined4 local_47dc;
undefined4 local_47d8;
undefined4 local_47d4;
undefined4 local_47d0;
float local_47c8;
float local_47c4;
float local_47c0;
undefined4 local_47bc;
undefined4 local_47b8;
Path *local_47b4;
undefined4 local_47b0;
undefined4 local_47ac;
Path *local_47a8;
float local_47a4;
float local_47a0;
float local_479c;
undefined4 local_4798;
undefined4 local_4794;
undefined4 local_4790;
undefined **local_478c;
INextBot *local_4788;
CBaseEntity *local_4784;
undefined4 local_4780;
undefined4 local_477c;
undefined4 local_4778;
Path local_4774 [4];
float local_4770 [4352];
int local_370;
undefined4 local_354;
undefined4 local_350;
undefined4 local_34c;
undefined4 local_348;
undefined4 local_344;
undefined4 local_340;
undefined4 local_33c;
undefined4 local_338;
undefined4 local_334;
undefined1 local_330;
undefined4 local_324;
iVar5 = CGlobalEntityList::FindEntityByClassname
((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0,"infected");
if (iVar5 == 0) {
local_47f4 = 0;
}
else {
local_47f4 = __dynamic_cast(iVar5,&CBaseEntity::typeinfo,&Infected::typeinfo,0);
}
local_4804 = 1000;
if (1 < *(int *)param_1) {
local_4804 = strtol(*(char **)(param_1 + 0x40c),(char **)0x0,10);
}
if (local_47f4 != 0) {
Path::Path(local_4774);
local_478c = &PTR_operator___00d20e60;
pIVar6 = (INextBot *)(local_47f4 + 0x1a3c);
local_4788 = pIVar6;
local_4780 = (**(code **)(*(int *)(local_47f4 + 0x1a3c) + 0xc0))(pIVar6);
pCVar7 = (CBaseEntity *)(**(code **)(*(int *)(local_47f4 + 0x1a3c) + 0xb4))(pIVar6);
iVar5 = (**(code **)(*(int *)pCVar7 + 0x14c))(pCVar7);
if (iVar5 == 0) {
local_477c = 0x3f800000;
}
else {
local_477c = *(undefined4 *)(iVar5 + 0x1cec);
}
cVar4 = (**(code **)(*(int *)pCVar7 + 0x16c))(pCVar7);
local_4784 = (CBaseEntity *)0x0;
if (cVar4 != '\0') {
local_4784 = pCVar7;
}
this = (Path *)pCVar7;
iVar5 = CBaseEntity::GetTeamNumber(pCVar7);
local_4778 = 9;
if (iVar5 == 3) {
local_4778 = (**(code **)(*(int *)pCVar7 + 0x544))(pCVar7);
this = (Path *)pCVar7;
}
iVar5 = GetWorldEntity();
if (iVar5 != 0) {
uVar2 = *(undefined4 *)(iVar5 + 0x448);
local_47dc = 0;
uVar18 = *(undefined4 *)(iVar5 + 0x44c);
local_47d8 = 0;
uVar17 = *(undefined4 *)(iVar5 + 0x450);
uVar16 = *(undefined4 *)(iVar5 + 0x454);
uVar15 = *(undefined4 *)(iVar5 + 0x458);
this_00 = *(char **)(iVar5 + 0x45c);
if (_towlower == (Path *)0x0) {
local_47b4 = (Path *)0x0;
}
else {
this = _towlower;
(**(code **)(_towlower + 0x50))
(_towlower,&local_47dc,0,0,0,0,
"/data/src/game/server/terror/zombiebot/infected/infected.cpp",0xab,
&z_debug_path_stress_test(CCommand_const&)::tm_fmt,"(%s)%s",
"z_debug_path_stress_test","z_debug_path_stress_test",this_00,uVar15,uVar16,
uVar17,uVar18);
local_47b4 = _towlower;
}
iVar5 = _DAT_0105db00;
local_47bc = local_47dc;
local_47b8 = local_47d8;
/* try { // try from 00a14179 to 00a141d9 has its CatchHandler @ 00a1421f */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar8 = ThreadGetCurrentId(), iVar5 == iVar8)) {
if (*(char **)_DAT_0105d15c != "z_debug_path_stress_test") {
_DAT_0105d15c =
(Path *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd1fed0,(char *)0x0,0xd1fed0);
}
puVar1 = (uint *)(_DAT_0105d1e8 + 4 + *(int *)(_DAT_0105d15c + 0x70) * 8);
*puVar1 = *puVar1 | 4;
this = _DAT_0105d15c;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
if (0 < local_4804) {
local_47f8 = 0;
do {
/* try { // try from 00a139eb to 00a13af2 has its CatchHandler @ 00a14265 */
lVar13 = (longdouble)RandomFloat(uVar2,uVar16);
local_47c8 = (float)lVar13;
lVar13 = (longdouble)RandomFloat(uVar18,uVar15);
local_47c4 = (float)lVar13;
pIVar14 = (INextBot *)this_00;
lVar13 = (longdouble)RandomFloat(uVar17,this_00);
local_47c0 = (float)lVar13;
local_47d4 = 0;
local_47d0 = 0;
if (_towlower == (Path *)0x0) {
local_47a8 = (Path *)0x0;
}
else {
this_00 = (char *)&local_47d4;
(**(code **)(_towlower + 0x50))
(_towlower,this_00,0,0,0,0,"/data/src/game/server/nextbot/path/nextbotpath.h",
0x113,&Path::
Compute<InfectedPathCost>(INextBot*,Vector_const&,InfectedPathCost&,float)
::tm_fmt,"(%s)%s","NextBotSpiky","Path::Compute(goal)");
local_47a8 = _towlower;
}
iVar5 = _DAT_0105db00;
local_47b0 = local_47d4;
local_47ac = local_47d0;
/* try { // try from 00a13b30 to 00a13b34 has its CatchHandler @ 00a14237 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar8 = ThreadGetCurrentId(), iVar5 == iVar8)) {
if (*(char **)_DAT_0105d15c != "Path::Compute(goal)") {
this_00 = "Path::Compute(goal)";
/* try { // try from 00a140bf to 00a140e2 has its CatchHandler @ 00a14237 */
_DAT_0105d15c =
(Path *)CVProfNode::GetSubNode
((char *)_DAT_0105d15c,0xbfa1b7,(char *)0x0,0xbfa1cb);
}
puVar1 = (uint *)(_DAT_0105d1e8 + 4 + *(int *)(_DAT_0105d15c + 0x70) * 8);
*puVar1 = *puVar1 | 4;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
local_330 = 1;
local_370 = 0;
local_354 = 0;
local_350 = vec3_origin;
local_344 = 0x3f800000;
local_34c = DAT_01053d4c;
local_348 = DAT_01053d50;
local_340 = 0;
local_33c = 0;
local_338 = 0;
local_334 = 0;
local_324 = 0xffffffff;
/* try { // try from 00a13bd9 to 00a13ea8 has its CatchHandler @ 00a14255 */
pVVar9 = (Vector *)(**(code **)(*(int *)(local_47f4 + 0x1a3c) + 0xd4))(pIVar6);
this = (Path *)(**(code **)(*(int *)(local_47f4 + 0x1a3c) + 0xb4))(pIVar6);
pCVar10 = (CNavArea *)(**(code **)(*(int *)this + 0x52c))(this);
if (pCVar10 != (CNavArea *)0x0) {
this_00 = (char *)CNavMesh::GetNearestNavArea
(TheNavMesh,(Vector *)&local_47c8,true,200.0,true,true,false
);
if (pCVar10 == (CNavArea *)this_00) {
LAB_00a1411e:
this = local_4774;
this_00 = (char *)pIVar6;
/* try { // try from 00a1413b to 00a1416d has its CatchHandler @ 00a14255 */
Path::BuildTrivialPath(this,pIVar6,(Vector *)&local_47c8);
}
else {
local_47a4 = local_47c8;
local_47a0 = local_47c4;
local_479c = local_47c0;
if ((CNavArea *)this_00 == (CNavArea *)0x0) {
CNavMesh::GetGroundHeight
(TheNavMesh,(Vector *)&local_47a4,&local_479c,(Vector *)0x0);
}
else {
lVar13 = (longdouble)CNavArea::GetZ((CNavArea *)this_00,local_47c8,local_47c4);
local_479c = (float)lVar13;
}
pCVar7 = (CBaseEntity *)(**(code **)(*(int *)(local_47f4 + 0x1a3c) + 0xb4))(pIVar6);
if (((byte)pCVar7[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar7);
}
local_47e0 = (CNavArea *)0x0;
local_4798 = *(undefined4 *)(pCVar7 + 0x2e0);
local_4794 = *(undefined4 *)(pCVar7 + 0x2e4);
local_4790 = *(undefined4 *)(pCVar7 + 0x2e8);
pCVar7 = (CBaseEntity *)(**(code **)(*(int *)(local_47f4 + 0x1a3c) + 0xb4))(pIVar6);
iVar5 = CBaseEntity::GetTeamNumber(pCVar7);
this = (Path *)pCVar10;
NavAreaBuildPath<InfectedPathCost>
(pCVar10,(CNavArea *)this_00,(Vector *)&local_4798,(Vector *)&local_47c8,
(InfectedPathCost *)&local_478c,&local_47e0,0.0,iVar5,false);
if (local_47e0 != (CNavArea *)0x0) {
if (pCVar10 == local_47e0) goto LAB_00a1411e;
iVar5 = 1;
pCVar11 = local_47e0;
do {
pCVar11 = *(CNavArea **)(pCVar11 + 0x78);
if (pCVar11 == (CNavArea *)0x0) break;
iVar5 = iVar5 + 1;
} while (pCVar10 != pCVar11);
if (iVar5 < 0x100) {
if (iVar5 == 1) goto LAB_00a1411e;
}
else {
local_370 = 0xff;
iVar5 = local_370;
}
local_370 = iVar5;
pCVar10 = local_47e0;
iVar5 = local_370;
pfVar12 = local_4770 + (local_370 + -1) * 0x11;
do {
*pfVar12 = (float)pCVar10;
iVar5 = iVar5 + -1;
CVar3 = pCVar10[0x7c];
pfVar12[6] = 0.0;
pfVar12[1] = (float)((byte)CVar3 & 0xf);
pCVar10 = *(CNavArea **)(pCVar10 + 0x78);
if (pCVar10 == (CNavArea *)0x0) break;
pfVar12 = pfVar12 + -0x11;
} while (iVar5 != 0);
local_4770[local_370 * 0x11] = (float)local_47e0;
local_4770[local_370 * 0x11 + 2] = local_47a4;
local_4770[local_370 * 0x11 + 3] = local_47a0;
local_4770[local_370 * 0x11 + 4] = local_479c;
local_4770[local_370 * 0x11 + 5] = 0.0;
local_4770[local_370 * 0x11 + 1] = 1.26117e-44;
local_4770[local_370 * 0x11 + 6] = 0.0;
this = local_4774;
this_00 = (char *)pIVar6;
local_370 = local_370 + 1;
cVar4 = Path::ComputePathDetails(this,pIVar6,pVVar9);
if (cVar4 == '\0') {
local_330 = 1;
local_370 = 0;
local_350 = vec3_origin;
local_354 = 0;
local_34c = DAT_01053d4c;
local_348 = DAT_01053d50;
local_344 = 0x3f800000;
local_340 = 0;
local_33c = 0;
local_338 = 0;
local_334 = 0;
local_324 = 0xffffffff;
}
else {
this_00 = (char *)pIVar6;
/* try { // try from 00a14077 to 00a14089 has its CatchHandler @ 00a14255 */
Path::Optimize((INextBot *)local_4774);
this = local_4774;
Path::PostProcess(this);
}
}
}
}
iVar5 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar8 = ThreadGetCurrentId(this,this_00), iVar5 == iVar8)) {
this = _DAT_0105d15c;
cVar4 = CVProfNode::ExitScope();
if (cVar4 != '\0') {
_DAT_0105d15c = *(Path **)(_DAT_0105d15c + 100);
}
DAT_0105d158 = _DAT_0105d15c == (Path *)0x105d160;
}
this_00 = (char *)pIVar14;
if (local_47a8 != (Path *)0x0) {
this = local_47a8;
(**(code **)(local_47a8 + 0x54))(local_47a8,local_47b0,local_47ac,0,0,0);
}
local_47f8 = local_47f8 + 1;
} while (local_47f8 != local_4804);
}
iVar5 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar8 = ThreadGetCurrentId(this), iVar5 == iVar8)) {
cVar4 = CVProfNode::ExitScope();
if (cVar4 != '\0') {
_DAT_0105d15c = *(Path **)(_DAT_0105d15c + 100);
}
DAT_0105d158 = _DAT_0105d15c == (Path *)0x105d160;
}
if (local_47b4 != (Path *)0x0) {
(**(code **)(local_47b4 + 0x54))(local_47b4,local_47bc,local_47b8,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.