SurvivorTeamSituation::operator()
0x009656d0 · 2895 bytes · __thiscall
_ZN21SurvivorTeamSituationclEP13CTerrorPlayer
Decompiled
undefined (2 params)
/* SurvivorTeamSituation::TEMPNAMEPLACEHOLDERVALUE(CTerrorPlayer*) */
undefined4 __thiscall
SurvivorTeamSituation::operator()(SurvivorTeamSituation *this,CTerrorPlayer *param_1)
{
SurvivorTeamSituation *pSVar1;
float fVar2;
float fVar3;
float fVar4;
float fVar5;
float fVar6;
CBaseEntity *pCVar7;
bool bVar8;
char cVar9;
char cVar10;
int iVar11;
int iVar12;
undefined4 *puVar13;
undefined4 uVar14;
undefined4 uVar15;
int *piVar16;
undefined *puVar17;
longdouble lVar18;
longdouble lVar19;
uint uVar20;
float fVar21;
float local_28;
float local_24;
float local_20;
iVar11 = CBaseEntity::GetTeamNumber(*(CBaseEntity **)(this + 4));
cVar9 = (**(code **)(*(int *)param_1 + 300))(param_1);
if (((cVar9 != '\0') &&
(iVar12 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_1), iVar11 == iVar12)) &&
(iVar11 = (**(code **)(*(int *)param_1 + 0x52c))(param_1), iVar11 != 0)) {
uVar20 = *(uint *)(param_1 + 0x33c4);
if (((uVar20 != 0xffffffff) &&
(puVar17 = g_pEntityList + (uVar20 & 0xfff) * 0x10, puVar17 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar17 + 8) == uVar20 >> 0xc && (*(int *)(puVar17 + 4) != 0)))) {
puVar13 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
*(undefined4 *)(this + 0xd700) = *puVar13;
}
uVar20 = *(uint *)(param_1 + 0x3e68);
if (((uVar20 != 0xffffffff) &&
(puVar17 = g_pEntityList + (uVar20 & 0xfff) * 0x10, puVar17 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar17 + 8) == uVar20 >> 0xc && (*(int *)(puVar17 + 4) != 0)))) {
puVar13 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
*(undefined4 *)(this + 0xd704) = *puVar13;
}
uVar20 = *(uint *)(param_1 + 0x3e48);
if ((((uVar20 != 0xffffffff) &&
(puVar17 = g_pEntityList + (uVar20 & 0xfff) * 0x10, puVar17 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar17 + 8) == uVar20 >> 0xc)) && (*(int *)(puVar17 + 4) != 0)) {
puVar13 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
*(undefined4 *)(this + 0xd708) = *puVar13;
}
uVar20 = *(uint *)(param_1 + 0x3ee0);
if (((uVar20 != 0xffffffff) &&
(puVar17 = g_pEntityList + (uVar20 & 0xfff) * 0x10, puVar17 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar17 + 8) == uVar20 >> 0xc && (*(int *)(puVar17 + 4) != 0)))) {
puVar13 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
*(undefined4 *)(this + 0xd70c) = *puVar13;
}
cVar9 = CTerrorPlayer::IsFiringWeapon(param_1);
if (cVar9 != '\0') {
lVar18 = (longdouble)CountdownTimer::Now();
if ((float)lVar18 + 3.0 != *(float *)(this + 0xd728)) {
(**(code **)(*(int *)(this + 0xd720) + 4))(this + 0xd720,this + 0xd728);
*(float *)(this + 0xd728) = (float)lVar18 + 3.0;
}
if (*(float *)(this + 0xd724) != 3.0) {
(**(code **)(*(int *)(this + 0xd720) + 4))(this + 0xd720,this + 0xd724);
*(undefined4 *)(this + 0xd724) = 0x40400000;
}
}
cVar9 = (**(code **)(*(int *)param_1 + 0x7e8))(param_1);
if ((cVar9 != '\0') ||
(iVar11 = *(int *)(param_1 + 0x100),
lVar18 = (longdouble)(**(code **)(*(int *)param_1 + 0x7e4))(param_1),
*(float *)(this + 0x1c) <= (float)lVar18 + (float)iVar11)) {
cVar9 = '\0';
}
else {
cVar9 = SurvivorBot::IsReachable(*(SurvivorBot **)(this + 4),param_1);
if (cVar9 != '\0') {
puVar13 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
*(undefined4 *)(this + 0x18) = *puVar13;
iVar11 = *(int *)(param_1 + 0x100);
lVar18 = (longdouble)(**(code **)(*(int *)param_1 + 0x7e4))(param_1);
*(float *)(this + 0x1c) = (float)lVar18 + (float)iVar11;
}
}
cVar10 = (**(code **)(*(int *)param_1 + 0x7e8))(param_1);
if (((cVar10 != '\0') ||
(cVar10 = (**(code **)(*(int *)param_1 + 0x5a8))(param_1), cVar10 != '\0')) ||
(iVar11 = *(int *)(param_1 + 0x100),
lVar18 = (longdouble)(**(code **)(*(int *)param_1 + 0x7e4))(param_1),
*(float *)(this + 0x24) <= (float)lVar18 + (float)iVar11)) {
bVar8 = false;
}
else {
cVar9 = SurvivorBot::IsReachable(*(SurvivorBot **)(this + 4),param_1);
if (cVar9 != '\0') {
puVar13 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
*(undefined4 *)(this + 0x20) = *puVar13;
iVar11 = *(int *)(param_1 + 0x100);
lVar18 = (longdouble)(**(code **)(*(int *)param_1 + 0x7e4))(param_1);
*(float *)(this + 0x24) = (float)lVar18 + (float)iVar11;
}
bVar8 = true;
}
lVar18 = (longdouble)CTerrorPlayer::GetFlowDistance(param_1,0);
uVar20 = -(uint)(0.0 < (float)lVar18);
fVar21 = (float)(~uVar20 & 0x3f800000 | (uint)(float)lVar18 & uVar20) +
(float)*(int *)(param_1 + 0x2ba0);
cVar10 = (**(code **)(*(int *)param_1 + 0x5a8))(param_1);
if (cVar10 == '\0') {
if (*(float *)(this + 0x58) <= fVar21 && fVar21 != *(float *)(this + 0x58)) {
puVar13 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
uVar14 = *puVar13;
*(float *)(this + 0x58) = fVar21;
*(undefined4 *)(this + 0x54) = uVar14;
}
}
else if (*(float *)(this + 0x60) <= fVar21 && fVar21 != *(float *)(this + 0x60)) {
puVar13 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
uVar14 = *puVar13;
*(float *)(this + 0x60) = fVar21;
*(undefined4 *)(this + 0x5c) = uVar14;
}
lVar18 = (longdouble)CTerrorPlayer::GetFlowDistance(param_1,0);
if ((float)lVar18 < *(float *)(this + 0x68)) {
puVar13 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
*(undefined4 *)(this + 100) = *puVar13;
lVar18 = (longdouble)CTerrorPlayer::GetFlowDistance(param_1,0);
*(float *)(this + 0x68) = (float)lVar18;
cVar10 = (**(code **)(*(int *)param_1 + 0x5a8))(param_1);
if (cVar10 == '\0') {
puVar13 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
*(undefined4 *)(this + 0x6c) = *puVar13;
lVar18 = (longdouble)CTerrorPlayer::GetFlowDistance(param_1,0);
*(float *)(this + 0x70) = (float)lVar18;
}
}
lVar18 = (longdouble)CTerrorPlayer::GetFlowDistance(param_1,0);
lVar19 = (longdouble)CTerrorPlayer::GetFlowDistance(*(CTerrorPlayer **)(this + 4),0);
if ((float)lVar18 <= (float)lVar19) {
lVar18 = (longdouble)CTerrorPlayer::GetFlowDistance(param_1,0);
if ((float)lVar18 < *(float *)(this + 0x80)) {
puVar13 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
*(undefined4 *)(this + 0x7c) = *puVar13;
lVar18 = (longdouble)CTerrorPlayer::GetFlowDistance(param_1,0);
*(float *)(this + 0x80) = (float)lVar18;
}
}
else {
lVar18 = (longdouble)CTerrorPlayer::GetFlowDistance(param_1,0);
if ((float)lVar18 < *(float *)(this + 0x78)) {
puVar13 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
*(undefined4 *)(this + 0x74) = *puVar13;
lVar18 = (longdouble)CTerrorPlayer::GetFlowDistance(param_1,0);
*(float *)(this + 0x78) = (float)lVar18;
}
}
cVar10 = CTerrorPlayer::OwnsWeaponOfType(param_1,10);
if (cVar10 != '\0') {
*(int *)(this + 0x84) = *(int *)(this + 0x84) + 1;
}
cVar10 = (**(code **)(*(int *)(*(int *)(this + 4) + 0x4028) + 0xe0))
(*(int *)(this + 4) + 0x4028,param_1);
if (cVar10 == '\0') {
uVar20 = *(uint *)(param_1 + 0x3e68);
if (((((uVar20 == 0xffffffff) ||
(puVar17 = g_pEntityList + (uVar20 & 0xfff) * 0x10, puVar17 == (undefined *)0xfffffffc))
|| ((*(uint *)(puVar17 + 8) != uVar20 >> 0xc || (*(int *)(puVar17 + 4) == 0)))) &&
(((uVar20 = *(uint *)(param_1 + 0x3e48), uVar20 == 0xffffffff ||
(puVar17 = g_pEntityList + (uVar20 & 0xfff) * 0x10, puVar17 == (undefined *)0xfffffffc))
|| ((*(uint *)(puVar17 + 8) != uVar20 >> 0xc || (*(int *)(puVar17 + 4) == 0)))))) &&
((((((uVar20 = *(uint *)(param_1 + 0x33c4), uVar20 == 0xffffffff ||
(puVar17 = g_pEntityList + (uVar20 & 0xfff) * 0x10, puVar17 == (undefined *)0xfffffffc
)) || (*(uint *)(puVar17 + 8) != uVar20 >> 0xc)) ||
((*(int *)(puVar17 + 4) == 0 || (param_1[0x39f1] != (CTerrorPlayer)0x0)))) &&
(cVar10 = (**(code **)(*(int *)param_1 + 0x7e8))(param_1), cVar10 != '\0')) &&
(((uVar20 = *(uint *)(param_1 + 0x2e24), uVar20 == 0xffffffff ||
(puVar17 = g_pEntityList + (uVar20 & 0xfff) * 0x10, puVar17 == (undefined *)0xfffffffc))
|| ((*(uint *)(puVar17 + 8) != uVar20 >> 0xc || (*(int *)(puVar17 + 4) == 0)))))))) {
if (!bVar8) {
cVar9 = SurvivorBot::IsReachable(*(SurvivorBot **)(this + 4),param_1);
}
if (cVar9 == '\0') {
pCVar7 = *(CBaseEntity **)(this + 4);
if (((byte)pCVar7[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar7);
}
fVar21 = *(float *)(pCVar7 + 0x2e0);
fVar2 = *(float *)(pCVar7 + 0x2e4);
fVar3 = *(float *)(pCVar7 + 0x2e8);
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
}
fVar4 = *(float *)(param_1 + 0x2e8);
fVar5 = *(float *)(param_1 + 0x2e4);
fVar6 = *(float *)(param_1 + 0x2e0);
uVar14 = CBaseEntity::GetDebugName((CBaseEntity *)param_1);
uVar15 = CBaseEntity::GetDebugName(*(CBaseEntity **)(this + 4));
Msg("SURVIVORBOT (%s, [%f %f %f]) will not help incap (%s,[%f %f %f]): UNREACHABLE via NAV\n"
,uVar15,(double)fVar21,(double)fVar2,(double)fVar3,uVar14,(double)fVar6,(double)fVar5,
(double)fVar4);
CL4DGameStats::SurvivorBotNotHelpIncap
((CL4DGameStats *)CL4D_GameStats,*(SurvivorBot **)(this + 4),param_1);
}
else {
lVar18 = (longdouble)CTerrorPlayer::GetTimeSinceAttackedByEnemy(param_1);
fVar21 = (float)(~-(uint)((float)lVar18 < 3.0) & 0x3f800000 |
-(uint)((float)lVar18 < 3.0) & 0x3dcccccd) *
(float)*(int *)(param_1 + 0x100);
if (fVar21 < *(float *)(this + 0xc)) {
puVar13 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
uVar14 = *puVar13;
*(float *)(this + 0xc) = fVar21;
*(undefined4 *)(this + 8) = uVar14;
}
cVar9 = (**(code **)(*(int *)param_1 + 0x5a8))(param_1);
if ((cVar9 == '\0') && (fVar21 < *(float *)(this + 0x14))) {
puVar13 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
uVar14 = *puVar13;
*(float *)(this + 0x14) = fVar21;
*(undefined4 *)(this + 0x10) = uVar14;
}
}
}
pCVar7 = *(CBaseEntity **)(this + 4);
if (((byte)pCVar7[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar7);
}
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
}
local_28 = *(float *)(param_1 + 0x2e0) - *(float *)(pCVar7 + 0x2e0);
local_24 = *(float *)(param_1 + 0x2e4) - *(float *)(pCVar7 + 0x2e4);
local_20 = *(float *)(param_1 + 0x2e8) - *(float *)(pCVar7 + 0x2e8);
lVar18 = (longdouble)VectorNormalize((Vector *)&local_28);
fVar21 = (float)lVar18;
if (fVar21 < *(float *)(this + 0x2c)) {
puVar13 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
uVar14 = *puVar13;
*(float *)(this + 0x2c) = fVar21;
*(undefined4 *)(this + 0x28) = uVar14;
}
cVar9 = (**(code **)(*(int *)param_1 + 0x5a8))(param_1);
if ((cVar9 == '\0') && (fVar21 < *(float *)(this + 0x34))) {
puVar13 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
uVar14 = *puVar13;
*(float *)(this + 0x34) = fVar21;
*(undefined4 *)(this + 0x30) = uVar14;
}
if ((fVar21 < *(float *)(this + 0x3c)) &&
((lVar18 = (longdouble)CTerrorPlayer::GetTimeSinceLastFiredWeapon(param_1),
(float)lVar18 < 2.0 ||
(lVar18 = (longdouble)CTerrorPlayer::GetTimeSinceAttackedByEnemy(param_1),
(float)lVar18 < 2.0)))) {
puVar13 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
uVar14 = *puVar13;
*(float *)(this + 0x3c) = fVar21;
*(undefined4 *)(this + 0x38) = uVar14;
}
piVar16 = (int *)(**(code **)(**(int **)(this + 4) + 0x9ac))(*(int **)(this + 4));
cVar9 = (**(code **)(*piVar16 + 0xd0))(piVar16,param_1,1,0);
if (cVar9 != '\0') {
MarkFriendAsVisible(this,param_1);
if (fVar21 < *(float *)(this + 0x44)) {
puVar13 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
uVar14 = *puVar13;
*(float *)(this + 0x44) = fVar21;
*(undefined4 *)(this + 0x40) = uVar14;
fVar2 = *(float *)(SurvivorBotNeighborRange._28_4_ + 0x2c);
}
else {
fVar2 = *(float *)(SurvivorBotNeighborRange._28_4_ + 0x2c);
}
if (fVar21 < fVar2) {
*(int *)(this + 0xd6fc) = *(int *)(this + 0xd6fc) + 1;
}
}
if (*(float *)(this + 0x4c) <= fVar21 && fVar21 != *(float *)(this + 0x4c)) {
puVar13 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
uVar14 = *puVar13;
*(float *)(this + 0x4c) = fVar21;
*(undefined4 *)(this + 0x48) = uVar14;
}
iVar11 = *(int *)(this + 0xc4);
if (iVar11 < 3) {
puVar13 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
*(undefined4 *)(this + iVar11 * 4 + 0x88) = *puVar13;
iVar11 = *(int *)(this + 0xc4);
*(float *)(this + iVar11 * 4 + 0x94) = fVar21;
pSVar1 = this + iVar11 * 0xc + 0xa0;
*(float *)pSVar1 = local_28;
*(float *)(pSVar1 + 4) = local_24;
*(float *)(pSVar1 + 8) = local_20;
*(int *)(this + 0xc4) = *(int *)(this + 0xc4) + 1;
return 1;
}
}
}
return 1;
}
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.