ForEachSurvivor<ItemRecipientScan>
0x00931ba0 · 1462 bytes · __cdecl
_Z15ForEachSurvivorI17ItemRecipientScanEbRT_
Decompiled
bool (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* bool ForEachSurvivor<ItemRecipientScan>(ItemRecipientScan&) */
bool ForEachSurvivor<ItemRecipientScan>(ItemRecipientScan *param_1)
{
char cVar1;
CBaseEntity *this;
int iVar2;
float *pfVar3;
QAngle *pQVar4;
int iVar5;
float fVar6;
float fVar7;
undefined4 local_10c;
undefined4 local_108;
undefined4 local_100;
undefined4 local_fc;
int local_f8;
float local_f4;
float local_f0;
float local_ec;
float local_e8;
float local_e4;
float local_e0;
undefined **local_dc [4];
float local_cc;
float local_c8;
float local_c4;
float local_bc;
float local_b8;
float local_b4;
undefined4 local_ac;
undefined4 local_a8;
undefined4 local_a4;
undefined4 local_9c;
undefined4 local_98;
undefined4 local_94;
undefined4 local_8c;
undefined1 local_88;
undefined1 local_87;
Vector local_70 [12];
Vector local_64 [32];
float local_44;
char local_39;
local_10c = 0;
local_108 = 0;
if (___atan2f_finite == 0) {
local_f8 = 0;
}
else {
(**(code **)(___atan2f_finite + 0x50))
(___atan2f_finite,&local_10c,0,0,0,0,"/data/src/game/server/terror/terrorplayer.h",
0xb2c,&ForEachSurvivor<ItemRecipientScan>(ItemRecipientScan&)::tm_fmt,"(%s)%s",
"Unaccounted","ForEachSurvivor");
local_f8 = ___atan2f_finite;
}
iVar5 = _DAT_0105db00;
local_100 = local_10c;
local_fc = local_108;
/* try { // try from 00931d5e to 00931dac has its CatchHandler @ 009320ab */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar2 = ThreadGetCurrentId(), iVar5 == iVar2)) {
if ((char *)*_DAT_0105d15c != "ForEachSurvivor") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc21c28,(char *)0x1,0xbfafa1);
}
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
if (0 < *(int *)(gpGlobals + 0x14)) {
iVar5 = 1;
do {
while ((this = (CBaseEntity *)UTIL_PlayerByIndex(iVar5), this == (CBaseEntity *)0x0 ||
(*(int *)(this + 0x30) == 0))) {
LAB_00931cb5:
iVar5 = iVar5 + 1;
if (*(int *)(gpGlobals + 0x14) < iVar5) goto LAB_00931cec;
}
if (*(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4 != 0) {
/* try { // try from 00931c85 to 00931cc4 has its CatchHandler @ 009320c3 */
cVar1 = (**(code **)(*(int *)this + 0x16c))(this);
/* try { // try from 00931e07 to 00932050 has its CatchHandler @ 009320c3 */
if ((((cVar1 != '\0') && (*(int *)(this + 0x1f6c) != 2)) &&
((iVar2 = CBaseEntity::GetTeamNumber(this), iVar2 == 2 &&
(((cVar1 = (**(code **)(*(int *)this + 300))(this), cVar1 != '\0' &&
(iVar2 = CBaseEntity::GetTeamNumber(this), iVar2 == 2)) &&
(cVar1 = (**(code **)(*(int *)this + 0x7e8))(this), cVar1 == '\0')))))) &&
(cVar1 = CTerrorPlayer::IsDominatedBySpecialInfected((CTerrorPlayer *)this),
cVar1 == '\0')) {
pfVar3 = (float *)(**(code **)(*(int *)this + 0x288))(this);
fVar6 = (*pfVar3 - *(float *)param_1) * (*pfVar3 - *(float *)param_1) +
(pfVar3[2] - *(float *)(param_1 + 8)) * (pfVar3[2] - *(float *)(param_1 + 8)) +
(pfVar3[1] - *(float *)(param_1 + 4)) * (pfVar3[1] - *(float *)(param_1 + 4));
if (((fVar6 <= 640000.0) && ((fVar6 <= 202500.0 || (*(float *)(param_1 + 0x14) <= -1.0))))
&& (fVar6 < *(float *)(param_1 + 0x10))) {
CTraceFilterSimple::CTraceFilterSimple
((CTraceFilterSimple *)local_dc,(IHandleEntity *)0x0,0,
IgnoreActorsTraceFilterFunction);
local_dc[0] = &PTR_ShouldHitEntity_00c23430;
pfVar3 = (float *)(**(code **)(*(int *)this + 0x288))(this);
local_cc = *(float *)param_1;
local_c8 = *(float *)(param_1 + 4);
local_bc = *pfVar3 - local_cc;
local_c4 = *(float *)(param_1 + 8);
local_b8 = pfVar3[1] - local_c8;
local_88 = 1;
local_94 = 0;
local_b4 = pfVar3[2] - local_c4;
local_98 = 0;
local_9c = 0;
local_8c = 0;
local_a4 = 0;
local_a8 = 0;
local_ac = 0;
local_87 = local_b8 * local_b8 + local_b4 * local_b4 + local_bc * local_bc != 0.0;
(**(code **)(*enginetrace + 0x14))(enginetrace,&local_cc,0x2006041,local_dc,local_70);
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
DebugDrawLine(local_70,local_64,0xff,0,0,true,-1.0);
}
if ((1.0 <= local_44) && (local_39 == '\0')) {
if (fVar6 < 202500.0) {
/* try { // try from 009320d8 to 00932141 has its CatchHandler @ 009320c3 */
pfVar3 = (float *)(**(code **)(*(int *)this + 0x288))(this);
local_f4 = *(float *)param_1 - *pfVar3;
local_f0 = *(float *)(param_1 + 4) - pfVar3[1];
local_ec = *(float *)(param_1 + 8) - pfVar3[2];
VectorNormalize((Vector *)&local_f4);
pQVar4 = (QAngle *)(**(code **)(*(int *)this + 0x238))(this);
AngleVectors(pQVar4,(Vector *)&local_e8);
fVar7 = local_e4 * local_f0 + local_e8 * local_f4 + local_e0 * local_ec;
if (fVar7 < *(float *)(param_1 + 0x14)) goto LAB_00931cb5;
*(float *)(param_1 + 0x14) = fVar7;
}
*(CBaseEntity **)(param_1 + 0xc) = this;
*(float *)(param_1 + 0x10) = fVar6;
}
}
}
goto LAB_00931cb5;
}
iVar5 = iVar5 + 1;
} while (iVar5 <= *(int *)(gpGlobals + 0x14));
}
LAB_00931cec:
iVar5 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar2 = ThreadGetCurrentId(), iVar5 == iVar2)) {
cVar1 = CVProfNode::ExitScope();
if (cVar1 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_f8 != 0) {
(**(code **)(local_f8 + 0x54))(local_f8,local_100,local_fc,0,0,0);
}
return true;
}
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.