SurvivorLegsMoveOn::MoveTowardsNextCheckpoint
0x0095c330 · 2922 bytes · __thiscall
_ZN18SurvivorLegsMoveOn25MoveTowardsNextCheckpointEP11SurvivorBot
Decompiled
undefined (2 params)
/* SurvivorLegsMoveOn::MoveTowardsNextCheckpoint(SurvivorBot*) */
void __thiscall
SurvivorLegsMoveOn::MoveTowardsNextCheckpoint(SurvivorLegsMoveOn *this,SurvivorBot *param_1)
{
float fVar1;
uint uVar2;
uint *puVar3;
char cVar4;
SurvivorTeamSituation *this_00;
int *piVar5;
undefined *puVar6;
CTerrorPlayer *this_01;
CBaseEntity *pCVar7;
CTerrorPlayer *pCVar8;
int iVar9;
undefined4 uVar10;
longdouble lVar11;
float local_28;
this_00 = (SurvivorTeamSituation *)SurvivorBot::GetTeamSituation(param_1);
uVar2 = *(uint *)(this_00 + 0x54);
if (((((uVar2 != 0xffffffff) &&
(puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar6 + 8) == uVar2 >> 0xc)) &&
((*(int *)(puVar6 + 4) != 0 && (*(char *)(*(int *)(puVar6 + 4) + 0x39e4) == '\0')))) ||
(cVar4 = CDirectorSessionManager::IsWaitingForTeamReady
(*(CDirectorSessionManager **)(TheDirector + 0x634)), cVar4 != '\0'))
goto LAB_0095c5e0;
uVar2 = *(uint *)(this_00 + 0x28);
if (((uVar2 != 0xffffffff) &&
(puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar6 + 8) == uVar2 >> 0xc &&
((*(CTerrorPlayer **)(puVar6 + 4) != (CTerrorPlayer *)0x0 &&
(cVar4 = SurvivorBot::IsBehind(param_1,*(CTerrorPlayer **)(puVar6 + 4)), cVar4 != '\0'))))))
{
pCVar7 = (CBaseEntity *)0x0;
fVar1 = *(float *)(SurvivorBotSeparationDangerMaxRange._28_4_ + 0x2c);
uVar2 = *(uint *)(this_00 + 0x28);
if ((uVar2 != 0xffffffff) &&
((puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc &&
(*(uint *)(puVar6 + 8) == uVar2 >> 0xc)))) {
pCVar7 = *(CBaseEntity **)(puVar6 + 4);
}
if (((byte)pCVar7[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar7);
}
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
}
if (fVar1 * fVar1 <
(*(float *)(param_1 + 0x2e8) - *(float *)(pCVar7 + 0x2e8)) *
(*(float *)(param_1 + 0x2e8) - *(float *)(pCVar7 + 0x2e8)) +
(*(float *)(param_1 + 0x2e4) - *(float *)(pCVar7 + 0x2e4)) *
(*(float *)(param_1 + 0x2e4) - *(float *)(pCVar7 + 0x2e4)) +
(*(float *)(param_1 + 0x2e0) - *(float *)(pCVar7 + 0x2e0)) *
(*(float *)(param_1 + 0x2e0) - *(float *)(pCVar7 + 0x2e0))) goto LAB_0095c6ca;
}
cVar4 = SurvivorTeamSituation::IsAnyTeammateNearCheckpoint(this_00);
if ((cVar4 != '\0') ||
((cVar4 = CDirector::IsFinale(TheDirector), cVar4 != '\0' &&
(cVar4 = CDirector::IsFinaleVehicleReady(TheDirector), cVar4 != '\0')))) goto LAB_0095c6ca;
uVar2 = *(uint *)(this_00 + 0x48);
if ((uVar2 != 0xffffffff) &&
((((puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc &&
(*(uint *)(puVar6 + 8) == uVar2 >> 0xc)) &&
(*(CTerrorPlayer **)(puVar6 + 4) != (CTerrorPlayer *)0x0)) &&
(cVar4 = SurvivorBot::IsAheadOf(param_1,*(CTerrorPlayer **)(puVar6 + 4)), cVar4 != '\0')))) {
pCVar7 = (CBaseEntity *)0x0;
fVar1 = *(float *)(SurvivorBotSeparationDangerMaxRange._28_4_ + 0x2c);
uVar2 = *(uint *)(this_00 + 0x48);
if (((uVar2 != 0xffffffff) &&
(puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar6 + 8) == uVar2 >> 0xc)) {
pCVar7 = *(CBaseEntity **)(puVar6 + 4);
}
if (((byte)pCVar7[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar7);
}
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
}
if (fVar1 * fVar1 <
(*(float *)(param_1 + 0x2e4) - *(float *)(pCVar7 + 0x2e4)) *
(*(float *)(param_1 + 0x2e4) - *(float *)(pCVar7 + 0x2e4)) +
(*(float *)(param_1 + 0x2e0) - *(float *)(pCVar7 + 0x2e0)) *
(*(float *)(param_1 + 0x2e0) - *(float *)(pCVar7 + 0x2e0)) +
(*(float *)(param_1 + 0x2e8) - *(float *)(pCVar7 + 0x2e8)) *
(*(float *)(param_1 + 0x2e8) - *(float *)(pCVar7 + 0x2e8))) {
uVar2 = *(uint *)(this_00 + 0x48);
piVar5 = (int *)0x0;
if (((uVar2 != 0xffffffff) &&
(puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar6 + 8) == uVar2 >> 0xc)) {
piVar5 = *(int **)(puVar6 + 4);
}
cVar4 = (**(code **)(*piVar5 + 0x7e8))(piVar5);
if (cVar4 == '\0') {
LAB_0095c5e0:
Wait(this);
return;
}
uVar2 = *(uint *)(this_00 + 0x48);
pCVar8 = (CTerrorPlayer *)0x0;
if (((uVar2 != 0xffffffff) &&
(puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar6 + 8) == uVar2 >> 0xc)) {
pCVar8 = *(CTerrorPlayer **)(puVar6 + 4);
}
cVar4 = SurvivorBot::IsReachable(param_1,pCVar8);
if (cVar4 != '\0') goto LAB_0095c5e0;
}
}
cVar4 = CTerrorGameRules::IsVersusMode();
if (cVar4 == '\0') {
piVar5 = (int *)(**(code **)(*(int *)param_1 + 0x9a8))(param_1);
iVar9 = (**(code **)(*piVar5 + 0xb8))(piVar5,param_1 + 0x4028);
if (iVar9 != 1) {
lVar11 = (longdouble)CountdownTimer::Now();
if (*(float *)(this + 0x3c) <= (float)lVar11) {
lVar11 = (longdouble)CTerrorPlayer::GetTimeSinceLastFiredWeapon((CTerrorPlayer *)param_1);
if ((float)lVar11 < 1.0) {
if (*(int *)(this_00 + 0xc4) == 0) {
Wait(this);
}
uVar2 = *(uint *)(this_00 + 0x28);
if (((uVar2 != 0xffffffff) &&
(puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc))
&& ((*(uint *)(puVar6 + 8) == uVar2 >> 0xc &&
(pCVar7 = *(CBaseEntity **)(puVar6 + 4), pCVar7 != (CBaseEntity *)0x0)))) {
fVar1 = *(float *)(SurvivorBotSeparationRange._28_4_ + 0x2c);
if (((byte)pCVar7[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar7);
}
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
}
if ((*(float *)(param_1 + 0x2e4) - *(float *)(pCVar7 + 0x2e4)) *
(*(float *)(param_1 + 0x2e4) - *(float *)(pCVar7 + 0x2e4)) +
(*(float *)(param_1 + 0x2e0) - *(float *)(pCVar7 + 0x2e0)) *
(*(float *)(param_1 + 0x2e0) - *(float *)(pCVar7 + 0x2e0)) +
(*(float *)(param_1 + 0x2e8) - *(float *)(pCVar7 + 0x2e8)) *
(*(float *)(param_1 + 0x2e8) - *(float *)(pCVar7 + 0x2e8)) < fVar1 * fVar1) {
uVar2 = *(uint *)(this_00 + 0x50);
if (((uVar2 != 0xffffffff) &&
(puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10,
puVar6 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar6 + 8) == uVar2 >> 0xc &&
(pCVar7 = *(CBaseEntity **)(puVar6 + 4), pCVar7 != (CBaseEntity *)0x0)))) {
fVar1 = *(float *)(SurvivorBotSeparationDangerMaxRange._28_4_ + 0x2c);
if (((byte)pCVar7[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar7);
}
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
}
if (fVar1 * fVar1 <=
(*(float *)(param_1 + 0x2e4) - *(float *)(pCVar7 + 0x2e4)) *
(*(float *)(param_1 + 0x2e4) - *(float *)(pCVar7 + 0x2e4)) +
(*(float *)(param_1 + 0x2e0) - *(float *)(pCVar7 + 0x2e0)) *
(*(float *)(param_1 + 0x2e0) - *(float *)(pCVar7 + 0x2e0)) +
(*(float *)(param_1 + 0x2e8) - *(float *)(pCVar7 + 0x2e8)) *
(*(float *)(param_1 + 0x2e8) - *(float *)(pCVar7 + 0x2e8))) goto LAB_0095c7b4;
}
Wait(this);
}
}
}
LAB_0095c7b4:
uVar2 = *(uint *)(this_00 + 0x38);
if ((((uVar2 != 0xffffffff) &&
(puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc))
&& (*(uint *)(puVar6 + 8) == uVar2 >> 0xc)) &&
(pCVar7 = *(CBaseEntity **)(puVar6 + 4), pCVar7 != (CBaseEntity *)0x0)) {
fVar1 = *(float *)(SurvivorBotSeparationRange._28_4_ + 0x2c);
if (((byte)pCVar7[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar7);
}
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
}
if ((*(float *)(param_1 + 0x2e4) - *(float *)(pCVar7 + 0x2e4)) *
(*(float *)(param_1 + 0x2e4) - *(float *)(pCVar7 + 0x2e4)) +
(*(float *)(param_1 + 0x2e0) - *(float *)(pCVar7 + 0x2e0)) *
(*(float *)(param_1 + 0x2e0) - *(float *)(pCVar7 + 0x2e0)) +
(*(float *)(param_1 + 0x2e8) - *(float *)(pCVar7 + 0x2e8)) *
(*(float *)(param_1 + 0x2e8) - *(float *)(pCVar7 + 0x2e8)) < fVar1 * fVar1) {
Wait(this);
}
}
lVar11 = (longdouble)RandomFloat(0x3e800000,0x3f800000);
fVar1 = (float)lVar11;
lVar11 = (longdouble)CountdownTimer::Now();
if ((float)lVar11 + fVar1 != *(float *)(this + 0x3c)) {
(**(code **)(*(int *)(this + 0x34) + 4))(this + 0x34,this + 0x3c);
*(float *)(this + 0x3c) = (float)lVar11 + fVar1;
}
if (fVar1 != *(float *)(this + 0x38)) {
(**(code **)(*(int *)(this + 0x34) + 4))(this + 0x34,this + 0x38);
*(float *)(this + 0x38) = fVar1;
}
}
}
}
uVar2 = *(uint *)(this_00 + 0x54);
if (((uVar2 != 0xffffffff) &&
(puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar6 + 8) == uVar2 >> 0xc &&
(pCVar8 = *(CTerrorPlayer **)(puVar6 + 4), pCVar8 != (CTerrorPlayer *)0x0)))) {
lVar11 = (longdouble)CTerrorPlayer::GetFlowDistance(pCVar8,0);
local_28 = (float)lVar11;
lVar11 = (longdouble)CTerrorPlayer::GetFlowDistance((CTerrorPlayer *)param_1,0);
if (((float)lVar11 < local_28) &&
(iVar9 = (**(code **)(*(int *)param_1 + 0x9a8))(param_1), 0 < *(int *)(iVar9 + 0x70))) {
puVar3 = *(uint **)(iVar9 + 100);
uVar2 = *puVar3;
if (((uVar2 != 0xffffffff) &&
(((puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc &&
(*(uint *)(puVar6 + 8) == uVar2 >> 0xc)) &&
(pCVar7 = *(CBaseEntity **)(puVar6 + 4), pCVar7 != (CBaseEntity *)0x0)))) &&
(((iVar9 = CBaseEntity::GetTeamNumber(pCVar7), iVar9 == 3 &&
(iVar9 = (**(code **)(*(int *)pCVar7 + 0x544))(pCVar7), iVar9 == 7)) &&
(lVar11 = (longdouble)IntervalTimer::Now(), (float)lVar11 - (float)puVar3[6] < 3.0)))) {
uVar2 = *puVar3;
piVar5 = (int *)0x0;
if (((uVar2 != 0xffffffff) &&
(puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar6 + 8) == uVar2 >> 0xc)) {
piVar5 = *(int **)(puVar6 + 4);
}
piVar5 = (int *)(**(code **)(*piVar5 + 0x148))(piVar5);
piVar5 = (int *)(**(code **)(*piVar5 + 0xc4))(piVar5);
cVar4 = (**(code **)(*piVar5 + 0x114))(piVar5,2);
if (cVar4 == '\0') {
uVar10 = 0;
uVar2 = *puVar3;
if (((uVar2 != 0xffffffff) &&
(puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc))
&& (*(uint *)(puVar6 + 8) == uVar2 >> 0xc)) {
uVar10 = *(undefined4 *)(puVar6 + 4);
}
cVar4 = (**(code **)(*(int *)(param_1 + 0x4028) + 0x114))
(param_1 + 0x4028,uVar10,
*(undefined4 *)(ZombieWitchThreatHostileRange._28_4_ + 0x2c));
if (cVar4 != '\0') goto LAB_0095c6ca;
}
}
}
iVar9 = 0;
if (0 < *(int *)(this_00 + 0xc4)) {
do {
uVar2 = *(uint *)(this_00 + iVar9 * 4 + 0x88);
if (((uVar2 == 0xffffffff) ||
(puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar6 + 8) != uVar2 >> 0xc)) {
this_01 = (CTerrorPlayer *)0x0;
LAB_0095c8f4:
cVar4 = (**(code **)(*(int *)this_01 + 0x5a8))(this_01);
if (cVar4 == '\0') {
if (((byte)pCVar8[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)pCVar8);
}
if (((byte)this_01[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this_01);
}
if (((*(float *)(this_01 + 0x2e0) - *(float *)(pCVar8 + 0x2e0)) *
(*(float *)(this_01 + 0x2e0) - *(float *)(pCVar8 + 0x2e0)) +
(*(float *)(this_01 + 0x2e8) - *(float *)(pCVar8 + 0x2e8)) *
(*(float *)(this_01 + 0x2e8) - *(float *)(pCVar8 + 0x2e8)) +
(*(float *)(this_01 + 0x2e4) - *(float *)(pCVar8 + 0x2e4)) *
(*(float *)(this_01 + 0x2e4) - *(float *)(pCVar8 + 0x2e4)) < 22500.0) &&
(lVar11 = (longdouble)CTerrorPlayer::GetFlowDistance(this_01,0),
(float)lVar11 < local_28)) {
lVar11 = (longdouble)CTerrorPlayer::GetFlowDistance(this_01,0);
local_28 = (float)lVar11;
}
}
}
else {
this_01 = *(CTerrorPlayer **)(puVar6 + 4);
if (pCVar8 != this_01) goto LAB_0095c8f4;
}
iVar9 = iVar9 + 1;
} while (iVar9 < *(int *)(this_00 + 0xc4));
}
lVar11 = (longdouble)CTerrorPlayer::GetFlowDistance((CTerrorPlayer *)param_1,0);
if (local_28 <= (float)lVar11 + 100.0) {
Wait(this);
}
}
if ((0.0 < *(float *)(this + 100)) &&
(lVar11 = (longdouble)CountdownTimer::Now(), (float)lVar11 < *(float *)(this + 100))) {
return;
}
LAB_0095c6ca:
ApproachEscape(this,param_1);
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.