SurvivorBot::L4D1_ScavengeNearbyItems
0x0093a850 · 372 bytes · __cdecl
_ZN11SurvivorBot24L4D1_ScavengeNearbyItemsEP6ActionIS_E
Decompiled
undefined (1 param)
/* SurvivorBot::L4D1_ScavengeNearbyItems(Action<SurvivorBot>*) */
Action * SurvivorBot::L4D1_ScavengeNearbyItems(Action *param_1)
{
float fVar1;
char cVar2;
int iVar3;
CBaseEntity *pCVar4;
CWeaponCSBase *this;
SurvivorCollectObject *this_00;
longdouble lVar5;
SurvivorBot *in_stack_00000008;
int in_stack_0000000c;
undefined4 uVar6;
iVar3 = (**(code **)(*(int *)in_stack_00000008 + 0x52c))();
if ((((iVar3 != 0) &&
(pCVar4 = (CBaseEntity *)FindScavengeItem(in_stack_00000008,1500.0),
pCVar4 != (CBaseEntity *)0x0)) &&
(iVar3 = CDirectorItemManager::GetNavAreaForScavengeItem
(*(CDirectorItemManager **)(TheDirector + 0x62c),pCVar4), iVar3 != 0)) &&
(fVar1 = *(float *)(iVar3 + 0x154), lVar5 = (longdouble)CTerrorPlayer::GetFlowDistance(),
fVar1 <= (float)lVar5 + 250.0)) {
fVar1 = *(float *)(iVar3 + 0x154);
uVar6 = 0;
lVar5 = (longdouble)CTerrorPlayer::GetFlowDistance();
if (((float)lVar5 - 750.0 <= fVar1) &&
((this = (CWeaponCSBase *)(**(code **)(*(int *)pCVar4 + 0x188))(pCVar4,uVar6),
this == (CWeaponCSBase *)0x0 ||
(iVar3 = CWeaponCSBase::GetCSWpnData(this), *(int *)(iVar3 + 0x894) != 8)))) {
this_00 = ::operator_new(0x68);
/* try { // try from 0093a969 to 0093a96d has its CatchHandler @ 0093a9c8 */
SurvivorCollectObject::SurvivorCollectObject(this_00,pCVar4);
cVar2 = (**(code **)(*(int *)this_00 + 0x164))(this_00);
if (cVar2 == '\0') {
*(undefined4 *)param_1 = 2;
*(char **)(param_1 + 8) = "Scavenging something";
*(undefined4 *)(in_stack_0000000c + 0x20) = 0;
*(undefined4 *)(in_stack_0000000c + 0x24) = 0;
*(undefined4 *)(in_stack_0000000c + 0x28) = 0;
*(undefined4 *)(in_stack_0000000c + 0x2c) = 0;
*(SurvivorCollectObject **)(param_1 + 4) = this_00;
return param_1;
}
(**(code **)(*(int *)this_00 + 4))(this_00);
}
}
*(undefined4 *)param_1 = 0;
*(undefined4 *)(param_1 + 4) = 0;
*(undefined4 *)(param_1 + 8) = 0;
return param_1;
}
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.