SurvivorLegsCoverFriendInCombat::Update
0x0095f5e0 · 2400 bytes · __thiscall
_ZN31SurvivorLegsCoverFriendInCombat6UpdateEP11SurvivorBotf
Decompiled
undefined (3 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* SurvivorLegsCoverFriendInCombat::Update(SurvivorBot*, float) */
SurvivorLegsCoverFriendInCombat * __thiscall
SurvivorLegsCoverFriendInCombat::Update
(SurvivorLegsCoverFriendInCombat *this,SurvivorBot *param_1,float param_2)
{
INextBot *pIVar1;
uint *puVar2;
uint uVar3;
code *pcVar4;
CTerrorPlayer *pCVar5;
char cVar6;
int *piVar7;
int iVar8;
int iVar9;
int *piVar10;
undefined *puVar11;
int **ppiVar12;
CBaseEntity *pCVar13;
int in_GS_OFFSET;
float fVar14;
float fVar15;
int *local_1b0;
CTerrorPlayer *local_164;
float local_154;
float local_150;
float local_14c;
float local_148;
float local_144;
float local_140;
undefined **local_13c;
INextBot *local_138;
float local_134;
undefined1 local_130;
undefined1 local_12f;
CFmtStrN<256> local_12c [268];
int local_20;
ppiVar12 = (int **)&stack0xfffffe54;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
uVar3 = *(uint *)(param_1 + 0x34);
if ((((uVar3 == 0xffffffff) ||
(puVar11 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar11 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar11 + 8) != uVar3 >> 0xc)) || (*(int **)(puVar11 + 4) == (int *)0x0)) {
*(undefined4 *)this = 3;
*(undefined4 *)(this + 4) = 0;
*(char **)(this + 8) = "Friend is gone";
ppiVar12 = (int **)&stack0xfffffe54;
}
else {
local_1b0 = (int *)0x95f672;
cVar6 = (**(code **)(**(int **)(puVar11 + 4) + 300))();
if (cVar6 == '\0') {
if (0.0 < *(float *)(param_1 + 0x4848)) {
local_1b0 = (int *)0x95f698;
IntervalTimer::Now();
}
local_1b0 = (int *)0x95f700;
SurvivorCharacterName();
local_1b0 = (int *)0x95f728;
CFmtStrN<256>::CFmtStrN(local_12c,"Subject:%s,TimeToReunite:%f");
pcVar4 = *(code **)(*(int *)param_2 + 0x7b4);
local_1b0 = (int *)0x95f746;
CAI_Concept::CAI_Concept
((CAI_Concept *)&local_13c,"SurvivorBotFriendDiedBeforeSupportArrived");
local_1b0 = (int *)0x95f77f;
(*pcVar4)();
*(undefined4 *)this = 3;
*(undefined4 *)(this + 4) = 0;
*(char **)(this + 8) = "Friend is dead";
ppiVar12 = (int **)&stack0xfffffe54;
}
else {
pCVar5 = (CTerrorPlayer *)0x0;
uVar3 = *(uint *)(param_1 + 0x34);
if (((uVar3 != 0xffffffff) &&
(puVar11 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar11 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar11 + 8) == uVar3 >> 0xc)) {
pCVar5 = *(CTerrorPlayer **)(puVar11 + 4);
}
local_1b0 = (int *)0x95f7ff;
cVar6 = CTerrorPlayer::IsInCombat(pCVar5,true);
if (cVar6 == '\0') {
*(undefined4 *)this = 3;
*(undefined4 *)(this + 4) = 0;
*(char **)(this + 8) = "Friend is no longer in combat";
}
else {
pCVar5 = (CTerrorPlayer *)0x0;
uVar3 = *(uint *)(param_1 + 0x34);
if (((uVar3 != 0xffffffff) &&
(puVar11 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar11 != (undefined *)0xfffffffc))
&& (*(uint *)(puVar11 + 8) == uVar3 >> 0xc)) {
pCVar5 = *(CTerrorPlayer **)(puVar11 + 4);
}
local_1b0 = (int *)0x95f852;
cVar6 = SurvivorBot::IsReachable((SurvivorBot *)param_2,pCVar5);
if (cVar6 == '\0') {
if (0.0 < *(float *)(param_1 + 0x4848)) {
local_1b0 = (int *)0x95f878;
IntervalTimer::Now();
}
local_1b0 = (int *)0x95f8e0;
SurvivorCharacterName();
local_1b0 = (int *)0x95f908;
CFmtStrN<256>::CFmtStrN(local_12c,"Subject:%s,TimeToReunite:%f");
pcVar4 = *(code **)(*(int *)param_2 + 0x7b4);
local_1b0 = (int *)0x95f926;
CAI_Concept::CAI_Concept
((CAI_Concept *)&local_13c,"SurvivorBotCantSupportUnreachableFriend");
local_1b0 = (int *)0x95f95f;
(*pcVar4)();
*(undefined4 *)this = 3;
*(undefined4 *)(this + 4) = 0;
*(char **)(this + 8) = "Friend is not reachable";
ppiVar12 = (int **)&stack0xfffffe54;
}
else {
local_1b0 = (int *)0x95f9d3;
piVar7 = (int *)(**(code **)(*(int *)param_2 + 0x9a0))();
local_1b0 = (int *)0x95f9de;
cVar6 = (**(code **)(*piVar7 + 0xd4))();
if (cVar6 == '\0') {
local_164 = (CTerrorPlayer *)0x0;
uVar3 = *(uint *)(param_1 + 0x34);
if (((uVar3 != 0xffffffff) &&
(puVar11 = g_pEntityList + (uVar3 & 0xfff) * 0x10,
puVar11 != (undefined *)0xfffffffc)) && (*(uint *)(puVar11 + 8) == uVar3 >> 0xc)) {
local_164 = *(CTerrorPlayer **)(puVar11 + 4);
}
local_1b0 = (int *)0x95fa2c;
cVar6 = SurvivorBot::IsAbleToCoverFriend((SurvivorBot *)param_2,local_164);
if (cVar6 != '\0') {
*(undefined4 *)this = 3;
*(undefined4 *)(this + 4) = 0;
*(char **)(this + 8) = "In position to assist friend in combat";
ppiVar12 = (int **)&stack0xfffffe54;
goto LAB_0095f640;
}
}
pIVar1 = (INextBot *)((int)param_2 + 0x4028);
local_1b0 = (int *)0x95fac3;
cVar6 = (**(code **)(*(int *)((int)param_2 + 0x4028) + 0x11c))();
if (cVar6 == '\0') {
local_164 = (CTerrorPlayer *)0x0;
uVar3 = *(uint *)(param_1 + 0x34);
if (((uVar3 != 0xffffffff) &&
(puVar11 = g_pEntityList + (uVar3 & 0xfff) * 0x10,
puVar11 != (undefined *)0xfffffffc)) && (*(uint *)(puVar11 + 8) == uVar3 >> 0xc)) {
local_164 = *(CTerrorPlayer **)(puVar11 + 4);
}
local_1b0 = (int *)0x95fd6e;
CBasePlayer::EyeVectors
((CBasePlayer *)local_164,(Vector *)&local_154,(Vector *)0x0,(Vector *)0x0);
local_1b0 = (int *)0x95fd79;
piVar10 = (int *)(**(code **)(*(int *)param_2 + 0x9a4))();
uVar3 = *(uint *)(param_1 + 0x34);
piVar7 = (int *)0x0;
pcVar4 = *(code **)(*piVar10 + 0xc0);
fVar14 = local_154 * 1000.0;
fVar15 = local_150 * 1000.0;
if (((uVar3 != 0xffffffff) &&
(puVar11 = g_pEntityList + (uVar3 & 0xfff) * 0x10,
puVar11 != (undefined *)0xfffffffc)) && (*(uint *)(puVar11 + 8) == uVar3 >> 0xc)) {
piVar7 = *(int **)(puVar11 + 4);
}
local_1b0 = (int *)0x95fe0d;
(**(code **)(*piVar7 + 0x234))();
ppiVar12 = &local_1b0;
local_13c = (undefined **)(fVar14 + local_148);
local_138 = (INextBot *)(fVar15 + local_144);
local_134 = local_14c * 1000.0 + local_140;
local_1b0 = piVar10;
(*pcVar4)();
}
else {
local_13c = &PTR_operator___00d09770;
local_1b0 = (int *)0x95faf0;
local_138 = pIVar1;
local_134 = (float)(**(code **)(*(int *)((int)param_2 + 0x4028) + 0xc0))();
local_1b0 = (int *)0x95fb0b;
piVar7 = (int *)(**(code **)(*(int *)((int)param_2 + 0x4028) + 200))();
local_1b0 = (int *)0x95fb1a;
iVar8 = (**(code **)(*piVar7 + 0xb8))();
local_12f = 0;
local_130 = iVar8 != 0;
uVar3 = *(uint *)(param_1 + 0x34);
pCVar13 = (CBaseEntity *)0x0;
if (((uVar3 != 0xffffffff) &&
(puVar11 = g_pEntityList + (uVar3 & 0xfff) * 0x10,
puVar11 != (undefined *)0xfffffffc)) && (*(uint *)(puVar11 + 8) == uVar3 >> 0xc)) {
pCVar13 = *(CBaseEntity **)(puVar11 + 4);
}
local_154 = 0.0;
local_150 = 0.0;
if (_towlower == 0.0) {
local_140 = 0.0;
}
else {
local_1b0 = (int *)0x95fbde;
(**(code **)((int)_towlower + 0x50))();
local_140 = _towlower;
}
iVar8 = _DAT_0105db00;
local_148 = local_154;
local_144 = local_150;
if ((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) {
/* try { // try from 0095fc20 to 0095fc24 has its CatchHandler @ 0095ff7b */
local_1b0 = (int *)0x95fc25;
iVar9 = ThreadGetCurrentId();
if (iVar8 == iVar9) {
if ((char *)*_DAT_0105d15c != "ChasePath::Update") {
/* try { // try from 0095fef9 to 0095ff1c has its CatchHandler @ 0095ff7b */
local_1b0 = (int *)0x95fefe;
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode
((char *)_DAT_0105d15c,0xbfa1ef,(char *)0x0,0xca8906);
}
puVar2 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
*puVar2 = *puVar2 | 4;
local_1b0 = (int *)0x95ff1d;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
}
/* try { // try from 0095fc54 to 0095fc64 has its CatchHandler @ 0095ff93 */
local_1b0 = (int *)0x95fc59;
ChasePath::RefreshPath
((ChasePath *)(param_1 + 0x38),pIVar1,pCVar13,(IPathCost *)&local_13c,
(Vector *)0x0);
local_1b0 = (int *)0x95fc65;
PathFollower::Update((PathFollower *)(param_1 + 0x38),pIVar1);
iVar8 = _DAT_0105db00;
if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
local_1b0 = (int *)0x95fc82;
iVar9 = ThreadGetCurrentId();
if (iVar8 == iVar9) {
local_1b0 = (int *)0x95ff36;
cVar6 = CVProfNode::ExitScope();
if (cVar6 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
}
ppiVar12 = (int **)&stack0xfffffe54;
if (local_140 != 0.0) {
local_1b0 = (int *)0x95fcc6;
(**(code **)((int)local_140 + 0x54))();
ppiVar12 = (int **)&stack0xfffffe54;
}
}
*(undefined4 *)this = 0;
*(undefined4 *)(this + 4) = 0;
*(undefined4 *)(this + 8) = 0;
}
}
}
}
LAB_0095f640:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return this;
}
/* WARNING: Subroutine does not return */
*(undefined1 **)((int)ppiVar12 + -4) = &LAB_0095ff7b;
__stack_chk_fail();
}
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.