SmokerRetreatToCover::OnStart
0x00ac9d80 · 1680 bytes · __thiscall
_ZN20SmokerRetreatToCover7OnStartEP6SmokerP6ActionIS0_E
Decompiled
undefined (3 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* SmokerRetreatToCover::OnStart(Smoker*, Action<Smoker>*) */
SmokerRetreatToCover * __thiscall
SmokerRetreatToCover::OnStart(SmokerRetreatToCover *this,Smoker *param_1,Action *param_2)
{
Vector *pVVar1;
INextBot *pIVar2;
uint *puVar3;
CNavArea CVar4;
float fVar5;
bool bVar6;
char cVar7;
CNavArea *pCVar8;
undefined4 uVar9;
Path *this_00;
Vector *pVVar10;
int *piVar11;
CNavArea *pCVar12;
CBaseEntity *pCVar13;
int iVar14;
int iVar15;
Smoker *pSVar16;
longdouble lVar17;
int local_8c;
CNavArea *local_70;
undefined4 local_6c;
undefined4 local_68;
undefined4 local_60;
undefined4 local_5c;
int local_58;
float local_54;
float local_50;
float local_4c;
undefined4 local_48;
undefined4 local_44;
undefined4 local_40;
EscapeScan local_3c [4];
int local_38;
undefined **local_2c;
Action *local_28;
undefined4 local_24;
undefined4 local_20;
EscapeScan::EscapeScan(local_3c,(BossZombiePlayerBot *)param_2);
fVar5 = *(float *)(SmokerEscapeRange._28_4_ + 0x2c);
if (((byte)param_2[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_2);
}
pCVar8 = (CNavArea *)(**(code **)(*(int *)param_2 + 0x52c))(param_2);
SearchSurroundingAreas<EscapeScan>(pCVar8,(Vector *)(param_2 + 0x2e0),local_3c,fVar5,0,-1);
if (local_38 == 0) {
*(undefined4 *)this = 3;
*(undefined4 *)(this + 4) = 0;
*(char **)(this + 8) = "No escape found!";
return this;
}
uVar9 = CDirectorTacticalServices::GetClosestSurvivor
(*(CDirectorTacticalServices **)(TheDirector + 0x628),
(CBaseCombatCharacter *)param_2,true,true);
local_2c = &PTR_operator___00d34e38;
local_28 = param_2;
local_24 = (**(code **)(*(int *)param_2 + 0x9b0))(param_2);
local_6c = 0;
local_68 = 0;
pVVar1 = (Vector *)(local_38 + 0x2c);
pIVar2 = (INextBot *)(param_2 + 0x4028);
this_00 = (Path *)(param_1 + 0x34);
local_20 = uVar9;
if (_towlower == 0) {
local_58 = 0;
}
else {
(**(code **)(_towlower + 0x50))
(_towlower,&local_6c,0,0,0,0,"/data/src/game/server/nextbot/path/nextbotpath.h",0x113,
&Path::Compute<SmokerPathCost>(INextBot*,Vector_const&,SmokerPathCost&,float)::tm_fmt
,"(%s)%s","NextBotSpiky","Path::Compute(goal)");
local_58 = _towlower;
}
iVar14 = _DAT_0105db00;
local_60 = local_6c;
local_5c = local_68;
if ((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) {
/* try { // try from 00aca266 to 00aca2c6 has its CatchHandler @ 00aca426 */
iVar15 = ThreadGetCurrentId();
if (iVar14 == iVar15) {
if ((char *)*_DAT_0105d15c != "Path::Compute(goal)") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xbfa1b7,(char *)0x0,0xbfa1cb);
}
puVar3 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
*puVar3 = *puVar3 | 4;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
}
/* try { // try from 00ac9f09 to 00aca1e3 has its CatchHandler @ 00aca43b */
(**(code **)(*(int *)(param_1 + 0x34) + 0x48))(this_00);
pVVar10 = (Vector *)(**(code **)(*(int *)(param_2 + 0x4028) + 0xd4))(pIVar2);
piVar11 = (int *)(**(code **)(*(int *)(param_2 + 0x4028) + 0xb4))(pIVar2);
pCVar8 = (CNavArea *)(**(code **)(*piVar11 + 0x52c))(piVar11);
if (pCVar8 == (CNavArea *)0x0) {
(**(code **)(*(int *)(param_1 + 0x34) + 100))(this_00,pIVar2,2);
goto LAB_00aca1e4;
}
pCVar12 = (CNavArea *)CNavMesh::GetNearestNavArea(TheNavMesh,pVVar1,true,200.0,true,true,false);
if (pCVar8 != pCVar12) {
local_54 = *(float *)(local_38 + 0x2c);
local_50 = *(float *)(local_38 + 0x30);
local_4c = *(float *)(local_38 + 0x34);
if (pCVar12 == (CNavArea *)0x0) {
CNavMesh::GetGroundHeight(TheNavMesh,(Vector *)&local_54,&local_4c,(Vector *)0x0);
}
else {
lVar17 = (longdouble)CNavArea::GetZ(pCVar12,local_54,local_50);
local_4c = (float)lVar17;
}
pCVar13 = (CBaseEntity *)(**(code **)(*(int *)(param_2 + 0x4028) + 0xb4))(pIVar2);
if (((byte)pCVar13[0x14d] & 8) != 0) {
/* try { // try from 00aca31d to 00aca321 has its CatchHandler @ 00aca43b */
CBaseEntity::CalcAbsolutePosition(pCVar13);
}
local_48 = *(undefined4 *)(pCVar13 + 0x2e0);
local_70 = (CNavArea *)0x0;
local_44 = *(undefined4 *)(pCVar13 + 0x2e4);
local_40 = *(undefined4 *)(pCVar13 + 0x2e8);
pCVar13 = (CBaseEntity *)(**(code **)(*(int *)(param_2 + 0x4028) + 0xb4))(pIVar2);
iVar14 = CBaseEntity::GetTeamNumber(pCVar13);
bVar6 = NavAreaBuildPath<SmokerPathCost>
(pCVar8,pCVar12,(Vector *)&local_48,pVVar1,(SmokerPathCost *)&local_2c,
&local_70,0.0,iVar14,false);
if (local_70 == (CNavArea *)0x0) goto LAB_00aca1e4;
if (pCVar8 != local_70) {
local_8c = 1;
pCVar12 = local_70;
do {
pCVar12 = *(CNavArea **)(pCVar12 + 0x78);
if (pCVar12 == (CNavArea *)0x0) break;
local_8c = local_8c + 1;
} while (pCVar8 != pCVar12);
if (local_8c < 0x100) {
if (local_8c == 1) goto LAB_00aca3dd;
*(int *)(param_1 + 0x4438) = local_8c;
}
else {
local_8c = 0xff;
*(undefined4 *)(param_1 + 0x4438) = 0xff;
}
pCVar8 = local_70;
iVar14 = local_8c;
pSVar16 = param_1 + (local_8c + -1) * 0x44 + 0x38;
do {
*(CNavArea **)pSVar16 = pCVar8;
iVar14 = iVar14 + -1;
CVar4 = pCVar8[0x7c];
*(undefined4 *)(pSVar16 + 0x18) = 0;
*(uint *)(pSVar16 + 4) = (byte)CVar4 & 0xf;
pCVar8 = *(CNavArea **)(pCVar8 + 0x78);
if (pCVar8 == (CNavArea *)0x0) break;
pSVar16 = pSVar16 + -0x44;
} while (iVar14 != 0);
local_8c = local_8c * 0x44;
*(CNavArea **)(param_1 + local_8c + 0x38) = local_70;
*(float *)(this_00 + local_8c + 0xc) = local_54;
*(float *)(this_00 + local_8c + 0x10) = local_50;
*(float *)(this_00 + local_8c + 0x14) = local_4c;
iVar14 = *(int *)(param_1 + 0x4438);
*(undefined4 *)(param_1 + iVar14 * 0x44 + 0x4c) = 0;
*(undefined4 *)(param_1 + iVar14 * 0x44 + 0x3c) = 9;
*(undefined4 *)(param_1 + iVar14 * 0x44 + 0x50) = 0;
*(int *)(param_1 + 0x4438) = iVar14 + 1;
cVar7 = Path::ComputePathDetails(this_00,pIVar2,pVVar10);
if (cVar7 == '\0') {
(**(code **)(*(int *)(param_1 + 0x34) + 0x48))(this_00);
(**(code **)(*(int *)(param_1 + 0x34) + 100))(this_00,pIVar2,2);
}
else {
/* try { // try from 00aca374 to 00aca420 has its CatchHandler @ 00aca43b */
Path::Optimize((INextBot *)this_00);
Path::PostProcess(this_00);
(**(code **)(*(int *)(param_1 + 0x34) + 100))(this_00,pIVar2,!bVar6);
}
goto LAB_00aca1e4;
}
}
LAB_00aca3dd:
Path::BuildTrivialPath(this_00,pIVar2,pVVar1);
LAB_00aca1e4:
iVar14 = _DAT_0105db00;
if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
iVar15 = ThreadGetCurrentId();
if (iVar14 == iVar15) {
cVar7 = CVProfNode::ExitScope();
if (cVar7 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
}
if (local_58 != 0) {
(**(code **)(local_58 + 0x54))(local_58,local_60,local_5c,0,0,0);
}
*(undefined4 *)this = 0;
*(undefined4 *)(this + 4) = 0;
*(undefined4 *)(this + 8) = 0;
return this;
}
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.