BoomerRetreatToCover::OnStart
0x00a74970 · 1581 bytes · __thiscall
_ZN20BoomerRetreatToCover7OnStartEP6BoomerP6ActionIS0_E
Decompiled
undefined (3 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* BoomerRetreatToCover::OnStart(Boomer*, Action<Boomer>*) */
BoomerRetreatToCover * __thiscall
BoomerRetreatToCover::OnStart(BoomerRetreatToCover *this,Boomer *param_1,Action *param_2)
{
Vector *pVVar1;
uint *puVar2;
CNavArea CVar3;
char cVar4;
bool bVar5;
CBaseEntity *pCVar6;
int iVar7;
Path *this_00;
Vector *pVVar8;
int *piVar9;
CNavArea *pCVar10;
CNavArea *pCVar11;
int iVar12;
int iVar13;
Boomer *pBVar14;
Action *pAVar15;
INextBot *pIVar16;
longdouble lVar17;
CNavArea *local_68;
undefined4 local_64;
undefined4 local_60;
undefined4 local_58;
undefined4 local_54;
int local_50;
float local_4c;
float local_48;
float local_44;
undefined4 local_40;
undefined4 local_3c;
undefined4 local_38;
undefined **local_34;
Action *local_30;
CBaseEntity *local_2c;
undefined4 local_28;
undefined4 local_24;
undefined4 local_20;
if (*(int *)(param_1 + 0x34) == 0) {
*(undefined4 *)this = 3;
*(undefined4 *)(this + 4) = 0;
*(char **)(this + 8) = "No escape found!";
return this;
}
pAVar15 = (Action *)0x0;
if (param_2 != (Action *)0x0) {
pAVar15 = param_2 + 0x4028;
}
local_34 = &PTR_operator___00d20e60;
local_30 = pAVar15;
local_28 = (**(code **)(*(int *)pAVar15 + 0xc0))(pAVar15);
pCVar6 = (CBaseEntity *)(**(code **)(*(int *)pAVar15 + 0xb4))(pAVar15);
iVar7 = (**(code **)(*(int *)pCVar6 + 0x14c))(pCVar6);
if (iVar7 == 0) {
local_24 = 0x3f800000;
}
else {
local_24 = *(undefined4 *)(iVar7 + 0x1cec);
}
cVar4 = (**(code **)(*(int *)pCVar6 + 0x16c))(pCVar6);
local_2c = (CBaseEntity *)0x0;
if (cVar4 != '\0') {
local_2c = pCVar6;
}
iVar7 = CBaseEntity::GetTeamNumber(pCVar6);
local_20 = 9;
if (iVar7 == 3) {
local_20 = (**(code **)(*(int *)pCVar6 + 0x544))(pCVar6);
}
local_64 = 0;
local_60 = 0;
iVar7 = *(int *)(param_1 + 0x34);
pVVar1 = (Vector *)(iVar7 + 0x2c);
pIVar16 = (INextBot *)0x0;
if (param_2 != (Action *)0x0) {
pIVar16 = (INextBot *)(param_2 + 0x4028);
}
this_00 = (Path *)(param_1 + 0x38);
if (_towlower == 0) {
local_50 = 0;
}
else {
(**(code **)(_towlower + 0x50))
(_towlower,&local_64,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_50 = _towlower;
}
iVar13 = _DAT_0105db00;
local_58 = local_64;
local_54 = local_60;
if ((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) {
/* try { // try from 00a74dee to 00a74e4e has its CatchHandler @ 00a74fb0 */
iVar12 = ThreadGetCurrentId();
if (iVar13 == iVar12) {
if ((char *)*_DAT_0105d15c != "Path::Compute(goal)") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xbfa1b7,(char *)0x0,0xbfa1cb);
}
puVar2 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
*puVar2 = *puVar2 | 4;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
}
/* try { // try from 00a74ae3 to 00a74d6f has its CatchHandler @ 00a74fc5 */
(**(code **)(*(int *)(param_1 + 0x38) + 0x48))(this_00);
pVVar8 = (Vector *)(**(code **)(*(int *)pIVar16 + 0xd4))(pIVar16);
piVar9 = (int *)(**(code **)(*(int *)pIVar16 + 0xb4))(pIVar16);
pCVar10 = (CNavArea *)(**(code **)(*piVar9 + 0x52c))(piVar9);
if (pCVar10 == (CNavArea *)0x0) {
/* try { // try from 00a74f3e to 00a74f83 has its CatchHandler @ 00a74fc5 */
(**(code **)(*(int *)(param_1 + 0x38) + 100))(this_00,pIVar16,2);
goto LAB_00a74d70;
}
pCVar11 = (CNavArea *)CNavMesh::GetNearestNavArea(TheNavMesh,pVVar1,true,200.0,true,true,false);
if (pCVar10 != pCVar11) {
local_4c = *(float *)(iVar7 + 0x2c);
local_48 = *(float *)(iVar7 + 0x30);
local_44 = *(float *)(iVar7 + 0x34);
if (pCVar11 == (CNavArea *)0x0) {
CNavMesh::GetGroundHeight(TheNavMesh,(Vector *)&local_4c,&local_44,(Vector *)0x0);
}
else {
lVar17 = (longdouble)CNavArea::GetZ(pCVar11,local_4c,local_48);
local_44 = (float)lVar17;
}
pCVar6 = (CBaseEntity *)(**(code **)(*(int *)pIVar16 + 0xb4))(pIVar16);
if (((byte)pCVar6[0x14d] & 8) != 0) {
/* try { // try from 00a74ea5 to 00a74eee has its CatchHandler @ 00a74fc5 */
CBaseEntity::CalcAbsolutePosition(pCVar6);
}
local_40 = *(undefined4 *)(pCVar6 + 0x2e0);
local_68 = (CNavArea *)0x0;
local_3c = *(undefined4 *)(pCVar6 + 0x2e4);
local_38 = *(undefined4 *)(pCVar6 + 0x2e8);
pCVar6 = (CBaseEntity *)(**(code **)(*(int *)pIVar16 + 0xb4))(pIVar16);
iVar7 = CBaseEntity::GetTeamNumber(pCVar6);
bVar5 = NavAreaBuildPath<InfectedPathCost>
(pCVar10,pCVar11,(Vector *)&local_40,pVVar1,(InfectedPathCost *)&local_34,
&local_68,0.0,iVar7,false);
if (local_68 == (CNavArea *)0x0) goto LAB_00a74d70;
if (pCVar10 != local_68) {
iVar7 = 1;
pCVar11 = local_68;
do {
pCVar11 = *(CNavArea **)(pCVar11 + 0x78);
if (pCVar11 == (CNavArea *)0x0) break;
iVar7 = iVar7 + 1;
} while (pCVar10 != pCVar11);
if (iVar7 < 0x100) {
if (iVar7 == 1) goto LAB_00a74f46;
*(int *)(param_1 + 0x443c) = iVar7;
}
else {
iVar7 = 0xff;
*(undefined4 *)(param_1 + 0x443c) = 0xff;
}
pCVar10 = local_68;
iVar13 = iVar7;
pBVar14 = param_1 + (iVar7 + -1) * 0x44 + 0x3c;
do {
*(CNavArea **)pBVar14 = pCVar10;
iVar13 = iVar13 + -1;
CVar3 = pCVar10[0x7c];
*(undefined4 *)(pBVar14 + 0x18) = 0;
*(uint *)(pBVar14 + 4) = (byte)CVar3 & 0xf;
pCVar10 = *(CNavArea **)(pCVar10 + 0x78);
if (pCVar10 == (CNavArea *)0x0) break;
pBVar14 = pBVar14 + -0x44;
} while (iVar13 != 0);
iVar7 = iVar7 * 0x44;
*(CNavArea **)(param_1 + iVar7 + 0x3c) = local_68;
*(float *)(this_00 + iVar7 + 0xc) = local_4c;
*(float *)(this_00 + iVar7 + 0x10) = local_48;
*(float *)(this_00 + iVar7 + 0x14) = local_44;
iVar7 = *(int *)(param_1 + 0x443c);
*(undefined4 *)(param_1 + iVar7 * 0x44 + 0x50) = 0;
*(undefined4 *)(param_1 + iVar7 * 0x44 + 0x40) = 9;
*(undefined4 *)(param_1 + iVar7 * 0x44 + 0x54) = 0;
*(int *)(param_1 + 0x443c) = iVar7 + 1;
cVar4 = Path::ComputePathDetails(this_00,pIVar16,pVVar8);
if (cVar4 == '\0') {
(**(code **)(*(int *)(param_1 + 0x38) + 0x48))(this_00);
(**(code **)(*(int *)(param_1 + 0x38) + 100))(this_00,pIVar16,2);
}
else {
Path::Optimize((INextBot *)this_00);
Path::PostProcess(this_00);
(**(code **)(*(int *)(param_1 + 0x38) + 100))(this_00,pIVar16,!bVar5);
}
goto LAB_00a74d70;
}
}
LAB_00a74f46:
Path::BuildTrivialPath(this_00,pIVar16,pVVar1);
LAB_00a74d70:
iVar7 = _DAT_0105db00;
if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
iVar13 = ThreadGetCurrentId();
if (iVar7 == iVar13) {
cVar4 = CVProfNode::ExitScope();
if (cVar4 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
}
if (local_50 != 0) {
(**(code **)(local_50 + 0x54))(local_50,local_58,local_54,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.