SurvivorBot::AcknowledgeFriendsAttention
0x0093b5a0 · 2527 bytes · __thiscall
_ZN11SurvivorBot27AcknowledgeFriendsAttentionEv
Decompiled
undefined (1 param)
/* SurvivorBot::AcknowledgeFriendsAttention() */
void __thiscall SurvivorBot::AcknowledgeFriendsAttention(SurvivorBot *this)
{
SurvivorBot *pSVar1;
float fVar2;
uint uVar3;
code *pcVar4;
char cVar5;
int iVar6;
undefined4 *puVar7;
int *piVar8;
undefined *puVar9;
int iVar10;
undefined4 uVar11;
int *piVar12;
int *piVar13;
int iVar14;
int iVar15;
int in_GS_OFFSET;
longdouble lVar16;
int aiStack_1b8 [3];
SurvivorBot local_17d;
int *local_170;
float local_168;
int local_164;
float local_15c;
float local_158;
float local_154;
float local_150;
float local_14c;
float local_148;
float local_144;
float local_140;
float local_13c;
float local_138;
float local_134;
float local_130;
undefined1 local_12c [5];
undefined1 local_127 [263];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
iVar6 = GetTeamSituation(this);
pSVar1 = this + 0x1ab04;
lVar16 = (longdouble)CountdownTimer::Now();
piVar12 = (int *)&stack0xfffffe54;
if ((((*(float *)(this + 0x1ab0c) <= (float)lVar16) &&
(cVar5 = CTerrorPlayer::IsInCombat((CTerrorPlayer *)this,false),
piVar12 = (int *)&stack0xfffffe54, cVar5 == '\0')) &&
(lVar16 = (longdouble)CountdownTimer::Now(), piVar12 = (int *)&stack0xfffffe54,
*(float *)(iVar6 + 0xd728) <= (float)lVar16)) &&
(cVar5 = (**(code **)(*(int *)this + 0x89c))(), piVar12 = (int *)&stack0xfffffe54,
cVar5 == '\0')) {
cVar5 = (**(code **)(*(int *)this + 0x7e8))();
local_17d = (SurvivorBot)0x1;
if ((cVar5 == '\0') && (this[0x33dc] == (SurvivorBot)0x0)) {
local_17d = this[0x39f1];
}
piVar12 = (int *)&stack0xfffffe54;
if (0 < *(int *)(iVar6 + 0xc4)) {
iVar14 = 0;
local_170 = (int *)0x0;
local_168 = 3.4028235e+38;
piVar8 = (int *)&stack0xfffffe54;
iVar15 = iVar6;
do {
uVar3 = *(uint *)(iVar15 + 0x88);
piVar12 = (int *)0x0;
if (((uVar3 != 0xffffffff) &&
(puVar9 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar9 + 8) == uVar3 >> 0xc)) {
piVar12 = *(int **)(puVar9 + 4);
}
iVar10 = *piVar12;
*piVar8 = (int)piVar12;
pcVar4 = *(code **)(iVar10 + 0x5a8);
piVar8[-1] = 0x93b706;
cVar5 = (*pcVar4)();
piVar12 = piVar8;
if ((cVar5 == '\0') && (*(float *)(iVar15 + 0x94) <= 500.0)) {
uVar3 = *(uint *)(iVar15 + 0x88);
piVar13 = (int *)0x0;
if ((uVar3 != 0xffffffff) &&
((puVar9 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc &&
(*(uint *)(puVar9 + 8) == uVar3 >> 0xc)))) {
piVar13 = *(int **)(puVar9 + 4);
}
iVar10 = *piVar13;
*piVar8 = (int)piVar13;
pcVar4 = *(code **)(iVar10 + 0x7e8);
piVar8[-1] = 0x93b761;
cVar5 = (*pcVar4)();
if (cVar5 == '\0') {
uVar3 = *(uint *)(iVar15 + 0x88);
if ((uVar3 == 0xffffffff) ||
(puVar9 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc))
{
if (DAT_000039f1 == '\0') {
LAB_0093b7bf:
piVar13 = (int *)0x0;
goto LAB_0093b7c1;
}
}
else {
if (*(uint *)(puVar9 + 8) == uVar3 >> 0xc) {
iVar10 = *(int *)(puVar9 + 4);
}
else {
iVar10 = 0;
}
if ((&DAT_000039f1)[iVar10] == '\0') {
if (*(uint *)(puVar9 + 8) != uVar3 >> 0xc) goto LAB_0093b7bf;
piVar13 = *(int **)(puVar9 + 4);
LAB_0093b7c1:
iVar10 = *piVar13;
*piVar8 = (int)piVar13;
pcVar4 = *(code **)(iVar10 + 0x550);
piVar8[-1] = 0x93b7cc;
cVar5 = (*pcVar4)();
if (cVar5 == '\0') {
uVar3 = *(uint *)(iVar15 + 0x88);
uVar11 = 0;
if (((uVar3 != 0xffffffff) &&
(puVar9 = g_pEntityList + (uVar3 & 0xfff) * 0x10,
puVar9 != (undefined *)0xfffffffc)) && (*(uint *)(puVar9 + 8) == uVar3 >> 0xc)
) {
uVar11 = *(undefined4 *)(puVar9 + 4);
}
piVar8[3] = 0;
piVar8[1] = (int)&local_15c;
piVar8[2] = 0;
*piVar8 = uVar11;
piVar8[-1] = 0x93b828;
CBasePlayer::EyeVectors
((CBasePlayer *)*piVar8,(Vector *)piVar8[1],(Vector *)piVar8[2],
(Vector *)piVar8[3]);
uVar3 = *(uint *)(iVar15 + 0x88);
piVar12 = (int *)0x0;
if (((uVar3 != 0xffffffff) &&
(puVar9 = g_pEntityList + (uVar3 & 0xfff) * 0x10,
puVar9 != (undefined *)0xfffffffc)) && (*(uint *)(puVar9 + 8) == uVar3 >> 0xc)
) {
piVar12 = *(int **)(puVar9 + 4);
}
iVar10 = *piVar12;
piVar8[1] = (int)piVar12;
*piVar8 = (int)&local_138;
pcVar4 = *(code **)(iVar10 + 0x234);
piVar8[-1] = 0x93b870;
(*pcVar4)();
iVar10 = *(int *)this;
*piVar8 = (int)this;
piVar8[-1] = (int)&local_144;
pcVar4 = *(code **)(iVar10 + 0x234);
piVar8[-2] = 0x93b88e;
(*pcVar4)();
local_150 = local_144 - local_138;
piVar8[-2] = (int)&local_150;
local_14c = local_140 - local_134;
local_148 = local_13c - local_130;
piVar8[-3] = 0x93b8e7;
lVar16 = (longdouble)VectorNormalize((Vector *)piVar8[-2]);
fVar2 = (float)lVar16;
piVar12 = piVar8 + -2;
if ((fVar2 < local_168) &&
(piVar12 = piVar8 + -2,
0.98 < local_14c * local_158 + local_150 * local_15c + local_148 * local_154))
{
iVar10 = *(int *)this;
piVar8[-2] = (int)this;
pcVar4 = *(code **)(iVar10 + 0x9ac);
piVar8[-3] = 0x93baf9;
piVar12 = (int *)(*pcVar4)();
local_164 = 0;
pcVar4 = *(code **)(*piVar12 + 0xd0);
uVar3 = *(uint *)(iVar15 + 0x88);
if ((uVar3 != 0xffffffff) &&
((puVar9 = g_pEntityList + (uVar3 & 0xfff) * 0x10,
puVar9 != (undefined *)0xfffffffc && (*(uint *)(puVar9 + 8) == uVar3 >> 0xc)
))) {
local_164 = *(int *)(puVar9 + 4);
}
piVar8[-2] = (int)piVar12;
piVar8[1] = 0;
*piVar8 = 1;
piVar8[-1] = local_164;
piVar8[-3] = 0x93bb77;
cVar5 = (*pcVar4)();
piVar12 = piVar8 + -2;
if (cVar5 != '\0') {
uVar3 = *(uint *)(iVar15 + 0x88);
local_168 = fVar2;
if (((uVar3 == 0xffffffff) ||
(puVar9 = g_pEntityList + (uVar3 & 0xfff) * 0x10,
puVar9 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar9 + 8) != uVar3 >> 0xc)) {
local_170 = (int *)0x0;
piVar12 = piVar8 + -2;
}
else {
local_170 = *(int **)(puVar9 + 4);
piVar12 = piVar8 + -2;
}
}
}
}
}
}
}
}
iVar14 = iVar14 + 1;
iVar15 = iVar15 + 4;
piVar8 = piVar12;
} while (iVar14 < *(int *)(iVar6 + 0xc4));
if (local_170 != (int *)0x0) {
*piVar12 = (int)pSVar1;
piVar12[-1] = 0x93b98a;
lVar16 = (longdouble)CountdownTimer::Now();
if ((float)lVar16 + 0.1 != *(float *)(this + 0x1ab0c)) {
iVar6 = *(int *)(this + 0x1ab04);
piVar12[1] = (int)(this + 0x1ab0c);
*piVar12 = (int)pSVar1;
pcVar4 = *(code **)(iVar6 + 4);
piVar12[-1] = 0x93bcc4;
(*pcVar4)();
*(float *)(this + 0x1ab0c) = (float)lVar16 + 0.1;
}
if (*(float *)(this + 0x1ab08) != 0.1) {
iVar6 = *(int *)(this + 0x1ab04);
piVar12[1] = (int)(this + 0x1ab08);
*piVar12 = (int)pSVar1;
pcVar4 = *(code **)(iVar6 + 4);
piVar12[-1] = 0x93b9f2;
(*pcVar4)();
*(undefined4 *)(this + 0x1ab08) = 0x3dcccccd;
}
uVar3 = *(uint *)(this + 0x1aba0);
if (((uVar3 == 0xffffffff) ||
(puVar9 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
((*(uint *)(puVar9 + 8) != uVar3 >> 0xc ||
((*(int **)(puVar9 + 4) == (int *)0x0 || (local_170 != *(int **)(puVar9 + 4))))))) {
iVar6 = *local_170;
*piVar12 = (int)local_170;
pcVar4 = *(code **)(iVar6 + 0xc);
piVar12[-1] = 0x93ba41;
puVar7 = (undefined4 *)(*pcVar4)();
*(undefined4 *)(this + 0x1aba0) = *puVar7;
*piVar12 = (int)(this + 0x1aba4);
piVar12[-1] = 0x93ba51;
lVar16 = (longdouble)IntervalTimer::Now();
if ((float)lVar16 != *(float *)(this + 0x1aba8)) {
iVar6 = *(int *)(this + 0x1aba4);
*piVar12 = (int)(this + 0x1aba4);
piVar12[1] = (int)(this + 0x1aba8);
pcVar4 = *(code **)(iVar6 + 4);
piVar12[-1] = 0x93ba8a;
(*pcVar4)();
*(float *)(this + 0x1aba8) = (float)lVar16;
}
}
else {
fVar2 = *(float *)(SurvivorBotMinAttentionNoticeTime._28_4_ + 0x2c);
*piVar12 = (int)(this + 0x1aba4);
piVar12[-1] = 0x93bd27;
lVar16 = (longdouble)IntervalTimer::Now();
if (fVar2 < (float)lVar16 - *(float *)(this + 0x1aba8)) {
uVar3 = *(uint *)(this + 0x1aba0);
uVar11 = 0;
if (((uVar3 != 0xffffffff) &&
(puVar9 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)
) && (*(uint *)(puVar9 + 8) == uVar3 >> 0xc)) {
uVar11 = *(undefined4 *)(puVar9 + 4);
}
*piVar12 = uVar11;
piVar12[-1] = 0x93bd85;
iVar6 = DescribeSubject((CBaseEntity *)*piVar12);
piVar12[1] = (int)"Subject:%s";
piVar12[2] = iVar6;
*piVar12 = (int)local_12c;
piVar12[-1] = 0x93bd9f;
CFmtStrN<256>::CFmtStrN((CFmtStrN<256> *)*piVar12,(char *)piVar12[1]);
pcVar4 = *(code **)(*(int *)this + 0x7b4);
if (local_17d == (SurvivorBot)0x0) {
piVar12[1] = (int)"SurvivorBotNoteHumanAttention";
}
else {
piVar12[1] = (int)"SurvivorBotNoteHumanAttentionNeedHelp";
}
*piVar12 = (int)&local_138;
piVar12[-1] = 0x93bdca;
CAI_Concept::CAI_Concept((CAI_Concept *)*piVar12,(char *)piVar12[1]);
piVar12[1] = (int)&local_138;
piVar12[3] = (int)local_127;
piVar12[6] = 0;
piVar12[5] = 0;
piVar12[4] = 0;
piVar12[2] = 1;
*piVar12 = (int)this;
piVar12[-1] = 0x93bdfd;
(*pcVar4)();
iVar6 = *(int *)this;
*piVar12 = (int)this;
pcVar4 = *(code **)(iVar6 + 0x9a4);
piVar12[-1] = 0x93be08;
piVar8 = (int *)(*pcVar4)();
pcVar4 = *(code **)(*piVar8 + 0xc4);
uVar3 = *(uint *)(this + 0x1aba0);
if (((uVar3 == 0xffffffff) ||
(puVar9 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)
) || (*(uint *)(puVar9 + 8) != uVar3 >> 0xc)) {
iVar6 = 0;
}
else {
iVar6 = *(int *)(puVar9 + 4);
}
piVar12[1] = iVar6;
*piVar12 = (int)piVar8;
piVar12[7] = 0x3e800000;
piVar12[6] = 1;
piVar12[5] = (int)"Looking at friend who is looking at me";
piVar12[4] = 0;
piVar12[3] = 0x3f800000;
piVar12[2] = 2;
piVar12[-1] = 0x93be7e;
(*pcVar4)();
*piVar12 = (int)pSVar1;
piVar12[-1] = 0x93be8c;
lVar16 = (longdouble)CountdownTimer::Now();
if ((float)lVar16 + 1.0 != *(float *)(this + 0x1ab0c)) {
iVar6 = *(int *)(this + 0x1ab04);
piVar12[1] = (int)(this + 0x1ab0c);
*piVar12 = (int)pSVar1;
pcVar4 = *(code **)(iVar6 + 4);
piVar12[-1] = 0x93bf9a;
(*pcVar4)();
*(float *)(this + 0x1ab0c) = (float)lVar16 + 1.0;
}
if (*(float *)(this + 0x1ab08) != 1.0) {
iVar6 = *(int *)(this + 0x1ab04);
piVar12[1] = (int)(this + 0x1ab08);
*piVar12 = (int)pSVar1;
pcVar4 = *(code **)(iVar6 + 4);
piVar12[-1] = 0x93bee0;
(*pcVar4)();
*(undefined4 *)(this + 0x1ab08) = 0x3f800000;
}
}
}
goto LAB_0093b5f3;
}
}
*(undefined4 *)(this + 0x1aba0) = 0xffffffff;
if (*(float *)(this + 0x1aba8) != -1.0) {
iVar6 = *(int *)(this + 0x1aba4);
*piVar12 = (int)(this + 0x1aba4);
piVar12[1] = (int)(this + 0x1aba8);
pcVar4 = *(code **)(iVar6 + 4);
piVar12[-1] = 0x93bf54;
(*pcVar4)();
*(undefined4 *)(this + 0x1aba8) = 0xbf800000;
}
*piVar12 = (int)pSVar1;
piVar12[-1] = 0x93bc2d;
lVar16 = (longdouble)CountdownTimer::Now();
if ((float)lVar16 + 0.25 != *(float *)(this + 0x1ab0c)) {
iVar6 = *(int *)(this + 0x1ab04);
piVar12[1] = (int)(this + 0x1ab0c);
*piVar12 = (int)pSVar1;
pcVar4 = *(code **)(iVar6 + 4);
piVar12[-1] = 0x93bf1b;
(*pcVar4)();
*(float *)(this + 0x1ab0c) = (float)lVar16 + 0.25;
}
if (*(float *)(this + 0x1ab08) != 0.25) {
iVar6 = *(int *)(this + 0x1ab04);
piVar12[1] = (int)(this + 0x1ab08);
*piVar12 = (int)pSVar1;
pcVar4 = *(code **)(iVar6 + 4);
piVar12[-1] = 0x93bc81;
(*pcVar4)();
*(undefined4 *)(this + 0x1ab08) = 0x3e800000;
}
}
LAB_0093b5f3:
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
*(undefined4 *)((int)piVar12 + -4) = 0x93bfbc;
__stack_chk_fail();
}
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.