CTerrorPlayer::FindPotentialLineOfScrimmage
0x009b2ce0 · 1062 bytes · __thiscall
_ZN13CTerrorPlayer28FindPotentialLineOfScrimmageEbfPfP6VectorP6QAngle
Decompiled
undefined (6 params)
/* CTerrorPlayer::FindPotentialLineOfScrimmage(bool, float, float*, Vector*, QAngle*) */
undefined4 __thiscall
CTerrorPlayer::FindPotentialLineOfScrimmage
(CTerrorPlayer *this,bool param_1,float param_2,float *param_3,Vector *param_4,
QAngle *param_5)
{
byte bVar1;
int iVar2;
CEscapeRoute *pCVar3;
undefined4 uVar4;
int *piVar5;
longdouble lVar6;
float fVar7;
float local_78;
float local_74;
undefined4 local_64;
undefined4 local_60;
undefined4 local_5c;
undefined4 local_58;
undefined4 local_54;
undefined4 local_50;
undefined4 local_4c;
undefined4 local_48;
undefined4 local_44;
int *local_40;
undefined4 local_3c;
undefined4 local_38;
undefined4 local_34;
undefined4 local_30;
undefined4 local_2c;
int *local_28;
undefined4 local_24;
undefined4 local_20;
iVar2 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
if ((iVar2 != 3) || (iVar2 = TheEscapeRoute(), iVar2 == 0)) {
return 0;
}
if (0.0 < param_2) {
pCVar3 = (CEscapeRoute *)TheEscapeRoute();
iVar2 = CEscapeRoute::GetAreaFromFlow(pCVar3,param_2,0);
if (iVar2 != 0) {
bVar1 = *(byte *)(iVar2 + 300);
while ((bVar1 & 0x40) != 0) {
param_2 = param_2 - 25.0;
pCVar3 = (CEscapeRoute *)TheEscapeRoute();
iVar2 = CEscapeRoute::GetAreaFromFlow(pCVar3,param_2,0);
if (iVar2 == 0) break;
bVar1 = *(byte *)(iVar2 + 300);
}
}
lVar6 = (longdouble)FindLineOfScrimmage(param_2,false,(Vector *)&local_4c,(QAngle *)&local_34);
if ((float)lVar6 <= 0.0) {
return 0;
}
*param_3 = (float)lVar6;
*(undefined4 *)param_4 = local_4c;
*(undefined4 *)(param_4 + 4) = local_48;
*(undefined4 *)(param_4 + 8) = local_44;
*(undefined4 *)param_5 = local_34;
*(undefined4 *)(param_5 + 4) = local_30;
*(undefined4 *)(param_5 + 8) = local_2c;
return 1;
}
uVar4 = CDirector::IsFinale(TheDirector);
if ((char)uVar4 != '\0') {
return 0;
}
lVar6 = (longdouble)GetLineOfScrimmageDistance();
local_4c = 0xc61c3c00;
local_74 = (float)lVar6;
local_48 = 2;
local_44 = 0;
local_40 = (int *)0x0;
local_3c = 0;
local_38 = 0;
local_34 = 0xc61c3c00;
local_30 = 2;
local_2c = 0;
local_28 = (int *)0x0;
local_24 = 8;
local_20 = 0;
ForEachTerrorPlayer<HighestFlowDistance>((HighestFlowDistance *)&local_4c);
ForEachTerrorPlayer<HighestFlowDistance>((HighestFlowDistance *)&local_34);
if (local_28 != local_40) {
return uVar4;
}
if (param_1) {
piVar5 = local_28;
if (local_28 == (int *)0x0) {
lVar6 = (longdouble)
FindLineOfScrimmage(local_74,false,(Vector *)&local_64,(QAngle *)&local_58);
goto joined_r0x009b3014;
}
}
else {
piVar5 = (int *)CDirectorTacticalServices::GetLowestFlowSurvivor();
if ((piVar5 == (int *)0x0) && (piVar5 = local_40, local_40 == (int *)0x0)) {
return uVar4;
}
}
iVar2 = (**(code **)(*piVar5 + 0x52c))(piVar5);
if (iVar2 == 0) {
local_78 = -9999.0;
}
else {
local_78 = *(float *)(iVar2 + 0x154);
}
if (param_1) {
local_74 = local_74 + local_78;
}
else {
local_74 = local_78 - local_74;
}
if (local_74 <= 0.0) {
local_74 = 0.0;
}
pCVar3 = (CEscapeRoute *)TheEscapeRoute();
iVar2 = CEscapeRoute::GetAreaFromFlow(pCVar3,local_74,0);
if (iVar2 != 0) {
bVar1 = *(byte *)(iVar2 + 300);
while ((bVar1 & 0x40) != 0) {
local_74 = local_74 - 25.0;
pCVar3 = (CEscapeRoute *)TheEscapeRoute();
iVar2 = CEscapeRoute::GetAreaFromFlow(pCVar3,local_74,0);
if (iVar2 == 0) break;
bVar1 = *(byte *)(iVar2 + 300);
}
}
fVar7 = *(float *)(TheNavMesh + 0x5f8) -
*(float *)(ZombieGhostLineOfScrimmageSafety._28_4_ + 0x2c);
if (local_74 <= fVar7) {
fVar7 = local_74;
}
if ((fVar7 < local_78) && (param_1)) {
return uVar4;
}
if ((local_78 < fVar7) && (!param_1)) {
return uVar4;
}
lVar6 = (longdouble)FindLineOfScrimmage(fVar7,false,(Vector *)&local_64,(QAngle *)&local_58);
joined_r0x009b3014:
if (0.0 < (float)lVar6) {
*param_3 = (float)lVar6;
*(undefined4 *)param_4 = local_64;
*(undefined4 *)(param_4 + 4) = local_60;
*(undefined4 *)(param_4 + 8) = local_5c;
*(undefined4 *)param_5 = local_58;
*(undefined4 *)(param_5 + 4) = local_54;
*(undefined4 *)(param_5 + 8) = local_50;
return 1;
}
return uVar4;
}
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.