CDirectorTacticalServices::GetSurvivorAbleToReachEntityFirst<SurvivorHasItemInSlotFilter>
0x00947940 · 551 bytes · __thiscall
_ZNK25CDirectorTacticalServices33GetSurvivorAbleToReachEntityFirstI27SurvivorHasItemInSlotFilterEEP13CTerrorPlayerP11CBaseEntityRKT_Pf
Decompiled
CTerrorPlayer * (4 params)
/* CTerrorPlayer*
CDirectorTacticalServices::GetSurvivorAbleToReachEntityFirst<SurvivorHasItemInSlotFilter>(CBaseEntity*,
SurvivorHasItemInSlotFilter const&, float*) const */
CTerrorPlayer * __thiscall
CDirectorTacticalServices::GetSurvivorAbleToReachEntityFirst<SurvivorHasItemInSlotFilter>
(CDirectorTacticalServices *this,CBaseEntity *param_1,SurvivorHasItemInSlotFilter *param_2
,float *param_3)
{
CTerrorPlayer *this_00;
char cVar1;
int iVar2;
int *piVar3;
CNavArea *pCVar4;
CNavArea *pCVar5;
int iVar6;
int iVar7;
float fVar8;
CTerrorPlayer *local_58;
float local_54;
ShortestPathCost local_41;
undefined4 local_40;
undefined4 local_3c;
undefined4 local_38;
undefined4 local_34;
int local_30 [8];
local_30[0] = 0;
local_30[1] = 0;
local_30[2] = 0;
local_30[3] = 0;
local_30[4] = 0;
local_40 = 2;
local_3c = 2;
local_38 = 3;
local_34 = 9;
/* try { // try from 00947991 to 00947b5c has its CatchHandler @ 00947b7b */
ForEachSurvivor<PlayerCollector>((PlayerCollector *)&local_40);
if (local_30[3] < 1) {
local_58 = (CTerrorPlayer *)0x0;
local_54 = 3.4028235e+38;
}
else {
iVar7 = 0;
local_58 = (CTerrorPlayer *)0x0;
local_54 = 3.4028235e+38;
LAB_00947a1a:
do {
this_00 = *(CTerrorPlayer **)(local_30[0] + iVar7 * 4);
if (*(int *)(this_00 + 0x30) == 0) {
iVar2 = *(int *)(param_1 + 0x30);
iVar6 = 0;
if (iVar2 != 0) goto LAB_009479da;
LAB_00947a30:
iVar2 = 0;
}
else {
iVar2 = *(int *)(param_1 + 0x30);
iVar6 = *(int *)(this_00 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
if (iVar2 == 0) goto LAB_00947a30;
LAB_009479da:
iVar2 = iVar2 - *(int *)(gpGlobals + 0x58) >> 4;
}
if (((iVar6 != iVar2) &&
(iVar2 = (**(code **)(*(int *)this_00 + 0x484))(this_00,*(undefined4 *)param_2),
iVar2 != 0)) && (cVar1 = CTerrorPlayer::IsAbleToMove(this_00), cVar1 != '\0')) {
iVar2 = (**(code **)(*(int *)param_1 + 0x144))(param_1);
if (iVar2 == 0) {
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(param_1);
}
pCVar4 = (CNavArea *)
CNavMesh::GetNearestNavArea
(TheNavMesh,(Vector *)(param_1 + 0x2e0),false,10000.0,false,true,false)
;
}
else {
piVar3 = (int *)(**(code **)(*(int *)param_1 + 0x144))(param_1);
pCVar4 = (CNavArea *)(**(code **)(*piVar3 + 0x52c))(piVar3);
}
pCVar5 = (CNavArea *)(**(code **)(*(int *)this_00 + 0x52c))(this_00);
fVar8 = NavAreaTravelDistance<ShortestPathCost>(pCVar5,pCVar4,&local_41,0.0);
fVar8 = fVar8 + (float)*(int *)(this_00 + 0x2ba0);
if (fVar8 < local_54) {
iVar7 = iVar7 + 1;
local_58 = this_00;
local_54 = fVar8;
if (local_30[3] <= iVar7) break;
goto LAB_00947a1a;
}
}
iVar7 = iVar7 + 1;
} while (iVar7 < local_30[3]);
}
if (param_3 != (float *)0x0) {
*param_3 = local_54;
}
local_30[3] = 0;
CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)local_30);
local_30[4] = local_30[0];
CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)local_30);
return local_58;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.