CDirectorItemManager::CollectHealingItems
0x008a4e40 · 370 bytes · __thiscall
_ZN20CDirectorItemManager19CollectHealingItemsEv
Decompiled
undefined (1 param)
/* CDirectorItemManager::CollectHealingItems() */
CDirectorItemManager * __thiscall
CDirectorItemManager::CollectHealingItems(CDirectorItemManager *this)
{
CBaseEntity *this_00;
int iVar1;
int *piVar2;
undefined4 uVar3;
int iVar4;
undefined4 *puVar5;
int iVar6;
undefined4 local_24;
undefined4 local_20;
piVar2 = mdlcache;
if (this[0x28] != (CDirectorItemManager)0x0) {
return this + 0x10;
}
local_24 = 0xffffffff;
(**(code **)(*mdlcache + 0x68))(mdlcache);
iVar1 = DAT_0100486c;
if (0 < DAT_0100486c) {
iVar6 = 0;
do {
while ((this_00 = *(CBaseEntity **)(TheWeaponSpawns + iVar6 * 4),
this_00 == (CBaseEntity *)0x0 || (((byte)this_00[0x14c] & 1) != 0))) {
LAB_008a4e98:
iVar6 = iVar6 + 1;
if (iVar6 == iVar1) goto LAB_008a4f80;
}
/* try { // try from 008a4ebd to 008a4f95 has its CatchHandler @ 008a4fb9 */
uVar3 = (**(code **)(*(int *)this_00 + 0x3cc))(this_00);
iVar4 = GetWeaponInfo(uVar3);
if ((iVar4 == 0) || (*(int *)(iVar4 + 0x894) != 8)) goto LAB_008a4e98;
if (((byte)this_00[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(this_00);
}
iVar4 = CNavMesh::GetNearestNavArea
(TheNavMesh,(Vector *)(this_00 + 0x2e0),false,10000.0,false,true,false);
if (iVar4 == 0) goto LAB_008a4e98;
puVar5 = (undefined4 *)(**(code **)(*(int *)this_00 + 0xc))(this_00);
local_24 = *puVar5;
local_20 = *(undefined4 *)(iVar4 + 0x154);
CUtlVector<CDirectorItemManager::HealingItemInfo,CUtlMemory<CDirectorItemManager::HealingItemInfo,int>>
::InsertBefore((CUtlVector<CDirectorItemManager::HealingItemInfo,CUtlMemory<CDirectorItemManager::HealingItemInfo,int>>
*)(this + 0x10),*(int *)(this + 0x1c),(HealingItemInfo *)&local_24);
iVar6 = iVar6 + 1;
} while (iVar6 != iVar1);
}
LAB_008a4f80:
CUtlVector<CDirectorItemManager::HealingItemInfo,CUtlMemory<CDirectorItemManager::HealingItemInfo,int>>
::Sort((CUtlVector<CDirectorItemManager::HealingItemInfo,CUtlMemory<CDirectorItemManager::HealingItemInfo,int>>
*)(this + 0x10),CompareFlow);
this[0x28] = (CDirectorItemManager)0x1;
*(undefined4 *)(this + 0x24) = 0;
(**(code **)(*piVar2 + 0x6c))(piVar2);
return this + 0x10;
}
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.