CBasePlayer::CanPickupObject
0x007ad270 · 561 bytes · __cdecl
_ZN11CBasePlayer15CanPickupObjectEP11CBaseEntityff
Decompiled
undefined (3 params)
/* WARNING: Removing unreachable block (ram,0x007ad3b9) */
/* WARNING: Removing unreachable block (ram,0x007ad4a6) */
/* CBasePlayer::CanPickupObject(CBaseEntity*, float, float) */
bool CBasePlayer::CanPickupObject(CBaseEntity *param_1,float param_2,float param_3)
{
float fVar1;
float fVar2;
float fVar3;
float fVar4;
float fVar5;
float fVar6;
int *piVar7;
char cVar8;
int iVar9;
uint uVar10;
int iVar11;
longdouble lVar12;
float local_1020;
undefined4 local_101c [1027];
if ((param_1 != (CBaseEntity *)0x0) && (param_1[0x186] == (CBaseEntity)0x6)) {
iVar9 = (**(code **)(*(int *)param_1 + 0x2b8))(param_1,local_101c,0x400);
if (iVar9 != 0) {
if (iVar9 < 1) {
local_1020 = 0.0;
}
else {
iVar11 = 0;
local_1020 = 0.0;
do {
piVar7 = (int *)local_101c[iVar11];
lVar12 = (longdouble)(**(code **)(*piVar7 + 0x78))(piVar7);
piVar7 = (int *)local_101c[iVar11];
local_1020 = (float)lVar12 + local_1020;
cVar8 = (**(code **)(*piVar7 + 0x2c))(piVar7);
if (cVar8 == '\0') {
return false;
}
piVar7 = (int *)local_101c[iVar11];
uVar10 = (**(code **)(*piVar7 + 0x50))(piVar7);
if ((uVar10 & 0x80) != 0) {
return false;
}
piVar7 = (int *)local_101c[iVar11];
cVar8 = (**(code **)(*piVar7 + 0x18))(piVar7);
if (cVar8 != '\0') {
return false;
}
iVar11 = iVar11 + 1;
} while (iVar11 != iVar9);
}
if ((local_1020 <= param_2) || (param_2 <= 0.0)) {
if (param_3 <= 0.0) {
return true;
}
if ((AllocTempVector()::s_vecTemp == '\0') &&
(iVar9 = __cxa_guard_acquire(&AllocTempVector()::s_vecTemp), iVar9 != 0)) {
__cxa_guard_release(&AllocTempVector()::s_vecTemp);
}
if ((AllocTempVector()::s_nIndex == '\0') &&
(iVar9 = __cxa_guard_acquire(&AllocTempVector()::s_nIndex), iVar9 != 0)) {
AllocTempVector()::s_nIndex = 0;
__cxa_guard_release(&AllocTempVector()::s_nIndex);
}
AllocTempVector()::s_nIndex = AllocTempVector()::s_nIndex + 0x10001 & 0x7f;
LOCK();
UNLOCK();
fVar1 = *(float *)(param_1 + 0x1a8);
iVar9 = AllocTempVector()::s_nIndex * 0xc;
fVar2 = *(float *)(param_1 + 0x19c);
*(float *)(AllocTempVector()::s_vecTemp + iVar9) = fVar1 - fVar2;
fVar3 = *(float *)(param_1 + 0x1ac);
fVar4 = *(float *)(param_1 + 0x1a0);
*(float *)(AllocTempVector()::s_vecTemp + iVar9 + 4) = fVar3 - fVar4;
fVar5 = *(float *)(param_1 + 0x1b0);
fVar6 = *(float *)(param_1 + 0x1a4);
*(float *)(AllocTempVector()::s_vecTemp + iVar9 + 8) = fVar5 - fVar6;
if ((fVar1 - fVar2 <= param_3) && (fVar3 - fVar4 <= param_3)) {
return fVar5 - fVar6 <= param_3;
}
}
}
}
return false;
}
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.