SurvivorLegsApproach::Update
0x009510c0 · 1791 bytes · __thiscall
_ZN20SurvivorLegsApproach6UpdateEP11SurvivorBotf
Decompiled
undefined (3 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* SurvivorLegsApproach::Update(SurvivorBot*, float) */
SurvivorLegsApproach * __thiscall
SurvivorLegsApproach::Update(SurvivorLegsApproach *this,SurvivorBot *param_1,float param_2)
{
SurvivorBot *pSVar1;
uint *puVar2;
float fVar3;
uint uVar4;
code *pcVar5;
char cVar6;
SurvivorBot SVar7;
int iVar8;
INextBot *pIVar9;
int iVar10;
int *piVar11;
int iVar12;
Vector *pVVar13;
undefined *puVar14;
int *piVar15;
longdouble lVar16;
int local_58;
int local_4c;
int local_48;
int local_44;
int local_40;
int local_3c;
int local_38;
int local_34;
int local_30;
undefined **local_2c;
int local_28;
undefined4 local_24;
undefined1 local_20;
undefined1 local_1f;
iVar8 = SurvivorBot::GetPace((SurvivorBot *)param_2);
if (iVar8 == 0) goto LAB_00951158;
if (iVar8 == 1) {
(**(code **)(*(int *)param_2 + 0x988))();
}
lVar16 = (longdouble)CountdownTimer::Now();
if (*(float *)(param_1 + 0x904c) <= (float)lVar16) {
piVar11 = (int *)(**(code **)(*(int *)param_2 + 0x9a0))();
cVar6 = (**(code **)(*piVar11 + 0xd4))();
if (cVar6 == '\0') {
PathFollower::Invalidate((PathFollower *)(param_1 + 0x4858));
if (*(float *)(param_1 + 0x483c) != -1.0) {
(**(code **)(*(int *)(param_1 + 0x4834) + 4))();
*(undefined4 *)(param_1 + 0x483c) = 0xbf800000;
}
if (*(float *)(param_1 + 0x4848) != -1.0) {
(**(code **)(*(int *)(param_1 + 0x4840) + 4))();
*(undefined4 *)(param_1 + 0x4848) = 0xbf800000;
}
PathFollower::Invalidate((PathFollower *)(param_1 + 0x48));
lVar16 = (longdouble)CountdownTimer::Now();
fVar3 = *(float *)(param_1 + 0x9048);
if ((float)lVar16 + fVar3 != *(float *)(param_1 + 0x904c)) {
(**(code **)(*(int *)(param_1 + 0x9044) + 4))();
*(float *)(param_1 + 0x904c) = (float)lVar16 + fVar3;
}
}
}
if (param_1[0x44] == (SurvivorBot)0x0) {
if (*(int *)(param_1 + 0x8c5c) < 1) {
ComputePath((SurvivorLegsApproach *)param_1,(SurvivorBot *)param_2);
}
pIVar9 = (INextBot *)0x0;
if (param_2 != 0.0) {
pIVar9 = (INextBot *)((int)param_2 + 0x4028);
}
PathFollower::Update((PathFollower *)(param_1 + 0x4858),pIVar9);
goto LAB_00951158;
}
uVar4 = *(uint *)(param_1 + 0x34);
if ((((uVar4 == 0xffffffff) ||
(puVar14 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar14 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar14 + 8) != uVar4 >> 0xc)) || (*(int *)(puVar14 + 4) == 0)) goto LAB_00951158;
iVar8 = *(int *)(*(int *)(puVar14 + 4) + 0x30);
if (iVar8 == 0) {
iVar8 = 0;
}
else {
iVar8 = iVar8 - *(int *)(gpGlobals + 0x58) >> 4;
}
if (*(int *)((int)param_2 + 0x30) == 0) {
iVar10 = 0;
}
else {
iVar10 = *(int *)((int)param_2 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
if (iVar8 == iVar10) goto LAB_00951158;
iVar8 = (int)param_2 + 0x4028;
local_2c = &PTR_operator___00d09770;
local_28 = iVar8;
local_24 = (**(code **)(*(int *)((int)param_2 + 0x4028) + 0xc0))();
piVar11 = (int *)(**(code **)(*(int *)((int)param_2 + 0x4028) + 200))();
iVar10 = (**(code **)(*piVar11 + 0xb8))();
local_1f = 0;
local_20 = iVar10 != 0;
uVar4 = *(uint *)(param_1 + 0x34);
local_58 = 0;
if (((uVar4 != 0xffffffff) &&
(puVar14 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar14 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar14 + 8) == uVar4 >> 0xc)) {
local_58 = *(int *)(puVar14 + 4);
}
pSVar1 = param_1 + 0x48;
piVar11 = (int *)(**(code **)(*(int *)((int)param_2 + 0x4028) + 0xc0))();
cVar6 = (**(code **)(*(int *)((int)param_2 + 0x4028) + 0x104))();
if (((cVar6 == '\0') && (cVar6 = (**(code **)(*piVar11 + 0xd4))(), cVar6 == '\0')) &&
((cVar6 = (**(code **)(*(int *)(param_1 + 0x48) + 0x80))(), cVar6 == '\0' &&
(cVar6 = (**(code **)(*(int *)(param_1 + 0x48) + 0x80))(), cVar6 == '\0')))) {
(**(code **)(*(int *)(param_1 + 0x48) + 0x90))();
piVar15 = (int *)&stack0xffffff60;
local_44 = local_38;
local_40 = local_34;
local_3c = local_30;
pcVar5 = *(code **)(*piVar11 + 0x158);
(**(code **)(*piVar11 + 300))();
cVar6 = (*pcVar5)();
if (cVar6 == '\0') {
LAB_009517f9:
piVar11 = &local_44;
piVar15 = (int *)&stack0xffffff60;
goto LAB_009513b1;
}
if (*(int *)(DirectChaseNavCheck._28_4_ + 0x30) != 0) {
pVVar13 = (Vector *)(**(code **)(*piVar11 + 300))();
cVar6 = CNavMesh::DoesRayStayWithinMesh(TheNavMesh,pVVar13,(Vector *)&local_38);
if (cVar6 == '\0') goto LAB_009517f9;
}
(**(code **)(*piVar11 + 0x120))();
(**(code **)(*piVar11 + 0xb4))();
piVar11 = (int *)(**(code **)(*(int *)((int)param_2 + 0x4028) + 0xc4))();
(**(code **)(*piVar11 + 0xc4))();
(**(code **)(*(int *)(param_1 + 0x48) + 0x48))();
param_1[0x4854] = (SurvivorBot)0x1;
}
else {
piVar11 = (int *)0x0;
piVar15 = (int *)&stack0xffffff64;
LAB_009513b1:
local_4c = 0;
local_48 = 0;
if (_towlower == 0) {
local_30 = 0;
}
else {
*piVar15 = _towlower;
piVar15[1] = (int)&local_4c;
piVar15[0xb] = (int)"ChasePath::Update";
piVar15[10] = (int)"NextBot";
piVar15[9] = (int)"(%s)%s";
piVar15[8] = (int)&ChasePath::Update(INextBot*,CBaseEntity*,IPathCost_const&,Vector*)::tm_fmt;
piVar15[7] = 0x68;
piVar15[6] = (int)"/data/src/game/server/nextbot/path/nextbotchasepath.h";
piVar15[5] = 0;
piVar15[3] = 0;
piVar15[4] = 0;
piVar15[2] = 0;
pcVar5 = *(code **)(_towlower + 0x50);
piVar15[-1] = 0x951429;
(*pcVar5)();
local_30 = _towlower;
}
iVar10 = _DAT_0105db00;
local_38 = local_4c;
local_34 = local_48;
if ((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) {
/* try { // try from 00951558 to 009515b9 has its CatchHandler @ 00951822 */
piVar15[-1] = 0x95155d;
iVar12 = ThreadGetCurrentId();
if (iVar10 == iVar12) {
if ((char *)*_DAT_0105d15c != "ChasePath::Update") {
piVar15[4] = 4;
piVar15[3] = (int)"NextBot";
piVar15[2] = 0;
piVar15[1] = (int)"ChasePath::Update";
*piVar15 = (int)_DAT_0105d15c;
piVar15[-1] = 0x95159b;
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode
((char *)*piVar15,piVar15[1],(char *)piVar15[2],piVar15[3]);
}
puVar2 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
*puVar2 = *puVar2 | 4;
*piVar15 = (int)_DAT_0105d15c;
piVar15[-1] = 0x9515ba;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
}
piVar15[4] = (int)piVar11;
piVar15[3] = (int)&local_2c;
piVar15[1] = iVar8;
piVar15[2] = local_58;
*piVar15 = (int)pSVar1;
/* try { // try from 00951478 to 0095148b has its CatchHandler @ 00951801 */
piVar15[-1] = 0x95147d;
ChasePath::RefreshPath
((ChasePath *)*piVar15,(INextBot *)piVar15[1],(CBaseEntity *)piVar15[2],
(IPathCost *)piVar15[3],(Vector *)piVar15[4]);
piVar15[1] = iVar8;
*piVar15 = (int)pSVar1;
piVar15[-1] = 0x95148c;
PathFollower::Update((PathFollower *)*piVar15,(INextBot *)piVar15[1]);
iVar10 = _DAT_0105db00;
if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
piVar15[-1] = 0x951513;
iVar12 = ThreadGetCurrentId();
if (iVar10 == iVar12) {
*piVar15 = (int)_DAT_0105d15c;
piVar15[-1] = 0x951524;
cVar6 = CVProfNode::ExitScope();
if (cVar6 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
}
if (local_30 != 0) {
piVar15[5] = 0;
piVar15[4] = 0;
piVar15[3] = 0;
*piVar15 = local_30;
piVar15[1] = local_38;
piVar15[2] = local_34;
pcVar5 = *(code **)(local_30 + 0x54);
piVar15[-1] = 0x9514d2;
(*pcVar5)();
}
iVar10 = *(int *)(param_1 + 0x48);
*piVar15 = (int)pSVar1;
pcVar5 = *(code **)(iVar10 + 0x44);
piVar15[-1] = 0x9514de;
SVar7 = (SurvivorBot)(*pcVar5)();
param_1[0x4854] = SVar7;
}
piVar15[2] = local_58;
piVar15[1] = iVar8;
*piVar15 = (int)pSVar1;
piVar15[-1] = 0x9514fd;
DirectChasePath::NotifyVictim
((DirectChasePath *)*piVar15,(INextBot *)piVar15[1],(CBaseEntity *)piVar15[2]);
LAB_00951158:
*(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.