CItemDefibrillator::GetTargetEntity
0x005416e0 · 367 bytes · __cdecl
_ZN18CItemDefibrillator15GetTargetEntityEP13CTerrorPlayerN17CBaseBackpackItem22BackpackItemActionTypeE
Decompiled
undefined (2 params)
/* CItemDefibrillator::GetTargetEntity(CTerrorPlayer*, CBaseBackpackItem::BackpackItemActionType) */
CBaseEntity * CItemDefibrillator::GetTargetEntity(undefined4 param_1,CBaseEntity *param_2)
{
code *pcVar1;
char cVar2;
CBaseEntity *pCVar3;
int iVar4;
float fVar5;
CBaseEntity *local_28;
float local_20;
fVar5 = *(float *)(player_use_radius._28_4_ + 0x2c);
local_20 = fVar5 * fVar5;
if (0 < DAT_01016aac) {
iVar4 = 0;
local_28 = (CBaseEntity *)0x0;
do {
pCVar3 = *(CBaseEntity **)(g_DeadSurvivors + iVar4 * 4);
if (pCVar3 != (CBaseEntity *)0x0) {
pcVar1 = *(code **)(*(int *)param_2 + 0x3cc);
if (((byte)pCVar3[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar3);
}
cVar2 = (*pcVar1)(param_2,pCVar3 + 0x2e0);
if (cVar2 != '\0') {
if (((byte)param_2[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(param_2);
}
if (((byte)pCVar3[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar3);
}
fVar5 = (*(float *)(pCVar3 + 0x2e4) - *(float *)(param_2 + 0x2e4)) *
(*(float *)(pCVar3 + 0x2e4) - *(float *)(param_2 + 0x2e4)) +
(*(float *)(pCVar3 + 0x2e0) - *(float *)(param_2 + 0x2e0)) *
(*(float *)(pCVar3 + 0x2e0) - *(float *)(param_2 + 0x2e0)) +
(*(float *)(pCVar3 + 0x2e8) - *(float *)(param_2 + 0x2e8)) *
(*(float *)(pCVar3 + 0x2e8) - *(float *)(param_2 + 0x2e8));
if (fVar5 < local_20) {
local_28 = pCVar3;
local_20 = fVar5;
}
}
}
iVar4 = iVar4 + 1;
} while (iVar4 < DAT_01016aac);
if (local_28 != (CBaseEntity *)0x0) {
return local_28;
}
fVar5 = *(float *)(player_use_radius._28_4_ + 0x2c);
}
pCVar3 = (CBaseEntity *)(**(code **)(*(int *)param_2 + 0x6e0))(param_2,fVar5,0,0,0,0);
return pCVar3;
}
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.