SurvivorReviveFriend::ShouldGiveUp
0x00935750 · 993 bytes · __thiscall
_ZNK20SurvivorReviveFriend12ShouldGiveUpEP11SurvivorBot
Decompiled
undefined (2 params)
/* SurvivorReviveFriend::ShouldGiveUp(SurvivorBot*) const */
char __thiscall SurvivorReviveFriend::ShouldGiveUp(SurvivorReviveFriend *this,SurvivorBot *param_1)
{
uint uVar1;
code *pcVar2;
char cVar3;
CBaseEntity *pCVar4;
undefined4 uVar5;
undefined4 uVar6;
int iVar7;
undefined *puVar8;
int iVar9;
undefined *puVar10;
int in_GS_OFFSET;
CAI_Concept local_134 [8];
CFmtStrN<256> local_12c [5];
undefined1 local_127 [263];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
uVar1 = *(uint *)(this + 0x34);
if ((((uVar1 != 0xffffffff) &&
(puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar10 + 8) == uVar1 >> 0xc)) &&
(pCVar4 = *(CBaseEntity **)(puVar10 + 4), pCVar4 != (CBaseEntity *)0x0)) {
cVar3 = (**(code **)(*(int *)pCVar4 + 300))(pCVar4);
if (cVar3 == '\0') {
uVar1 = *(uint *)(this + 0x34);
if (((uVar1 == 0xffffffff) ||
(puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) {
pCVar4 = (CBaseEntity *)0x0;
}
else {
pCVar4 = *(CBaseEntity **)(puVar10 + 4);
}
uVar5 = DescribeSubject(pCVar4);
CFmtStrN<256>::CFmtStrN(local_12c,"Subject:%s",uVar5);
pcVar2 = *(code **)(*(int *)param_1 + 0x7b4);
CAI_Concept::CAI_Concept(local_134,"SurvivorBotMovingToReviveFriendWhoDied");
cVar3 = '\x01';
(*pcVar2)(param_1,local_134,1,local_127,0,0,0);
goto LAB_009357a3;
}
uVar1 = *(uint *)(pCVar4 + 0x3e68);
if (((((uVar1 == 0xffffffff) ||
(puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
((*(uint *)(puVar10 + 8) != uVar1 >> 0xc || (*(int *)(puVar10 + 4) == 0)))) &&
((((uVar1 = *(uint *)(pCVar4 + 0x3e48), uVar1 == 0xffffffff ||
(puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc))
|| (*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) || (*(int *)(puVar10 + 4) == 0)))) &&
(((uVar1 = *(uint *)(pCVar4 + 0x33c4), uVar1 == 0xffffffff ||
(puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
((*(uint *)(puVar10 + 8) != uVar1 >> 0xc ||
((*(int *)(puVar10 + 4) == 0 || (pCVar4[0x39f1] != (CBaseEntity)0x0)))))))) {
uVar1 = *(uint *)(pCVar4 + 0x2e24);
if ((uVar1 == 0xffffffff) ||
(((puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc ||
(*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) ||
(*(CBaseEntity **)(puVar10 + 4) == (CBaseEntity *)0x0)))) {
LAB_00935964:
cVar3 = (**(code **)(*(int *)this + 0x16c))(this,param_1);
if (((cVar3 != '\0') && (uVar1 = *(uint *)(pCVar4 + 0x2e24), uVar1 != 0xffffffff)) &&
((puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc &&
(*(uint *)(puVar10 + 8) == uVar1 >> 0xc)))) {
cVar3 = *(int *)(puVar10 + 4) == 0;
}
}
else {
uVar1 = *(uint *)(param_1 + 0x2e28);
if (((uVar1 != 0xffffffff) &&
(puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar8 + 8) == uVar1 >> 0xc && (*(int *)(puVar8 + 4) != 0)))) {
if (*(int *)(pCVar4 + 0x30) == 0) {
iVar9 = 0;
}
else {
iVar9 = *(int *)(pCVar4 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
iVar7 = *(int *)(*(int *)(puVar8 + 4) + 0x30);
if (iVar7 == 0) {
iVar7 = 0;
}
else {
iVar7 = iVar7 - *(int *)(gpGlobals + 0x58) >> 4;
}
if (iVar9 == iVar7) goto LAB_00935964;
}
uVar5 = DescribeSubject(*(CBaseEntity **)(puVar10 + 4));
uVar6 = DescribeSubject(pCVar4);
CFmtStrN<256>::CFmtStrN(local_12c,"Subject:%s,Savior:%s",uVar6,uVar5);
pcVar2 = *(code **)(*(int *)param_1 + 0x7b4);
CAI_Concept::CAI_Concept(local_134,"SurvivorBotSomeoneElseReviveFriend");
(*pcVar2)(param_1,local_134,1,local_127,0,0,0);
}
goto LAB_009357a3;
}
}
cVar3 = '\x01';
LAB_009357a3:
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
return cVar3;
}
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.