CDirectorItemManager::FindExistingItems
0x008a6020 · 708 bytes · __thiscall
_ZN20CDirectorItemManager17FindExistingItemsEPKcPNS_15ItemRestoreInfoE17ItemRestoreInfo_t
Decompiled
undefined (4 params)
/* CDirectorItemManager::FindExistingItems(char const*, CDirectorItemManager::ItemRestoreInfo*,
ItemRestoreInfo_t) */
void __thiscall
CDirectorItemManager::FindExistingItems
(undefined4 this,char *param_1,undefined4 *param_2,int param_4)
{
int iVar1;
int iVar2;
code *pcVar3;
int *piVar4;
int *piVar5;
int *piVar6;
char *pcVar7;
int iVar8;
int iVar9;
int *piVar10;
bool bVar11;
int aiStackY_64 [2];
int local_4c;
int local_48;
int local_44;
int local_40;
int local_3c;
int local_2c;
char *local_20 [4];
bVar11 = param_4 == 1;
param_2[1] = param_4;
*param_2 = param_1;
pcVar7 = "prop_physics";
if (!bVar11) {
pcVar7 = param_1;
}
piVar5 = (int *)CGlobalEntityList::FindEntityByClassname
((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0,pcVar7);
piVar6 = (int *)&stack0xffffffa4;
do {
if (piVar5 == (int *)0x0) {
return;
}
piVar10 = piVar6;
if ((*(byte *)(piVar5 + 0x53) & 1) == 0) {
piVar4 = piVar6;
if (bVar11) {
iVar8 = *piVar5;
piVar6[1] = (int)piVar5;
*piVar6 = (int)local_20;
pcVar3 = *(code **)(iVar8 + 0x20);
piVar6[-1] = 0x8a624f;
(*pcVar3)();
piVar10 = piVar6 + -1;
pcVar7 = "";
if (local_20[0] != (char *)0x0) {
pcVar7 = local_20[0];
}
piVar4 = piVar6 + -1;
if (param_1 != pcVar7) {
*piVar6 = (int)pcVar7;
piVar6[-1] = (int)param_1;
/* try { // try from 008a6272 to 008a6276 has its CatchHandler @ 008a62f5 */
piVar6[-2] = 0x8a6277;
iVar8 = _V_stricmp((char *)piVar6[-1],(char *)*piVar6);
piVar4 = piVar6 + -1;
if (iVar8 != 0) goto LAB_008a61b7;
}
}
piVar10 = piVar4;
if ((*(byte *)((int)piVar5 + 0x14d) & 8) == 0) {
local_3c = piVar5[0xb8];
local_40 = piVar5[0xb9];
local_44 = piVar5[0xba];
}
else {
*piVar10 = (int)piVar5;
piVar10[-1] = 0x8a61f8;
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)*piVar10);
local_3c = piVar5[0xb8];
local_40 = piVar5[0xb9];
local_44 = piVar5[0xba];
if ((*(byte *)((int)piVar5 + 0x14d) & 8) != 0) {
*piVar10 = (int)piVar5;
piVar10[-1] = 0x8a6234;
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)*piVar10);
}
}
iVar8 = piVar5[0xdf];
iVar1 = piVar5[0xe0];
iVar2 = piVar5[0xe1];
piVar10[3] = 0;
piVar10[2] = (int)&CWeaponSpawn::typeinfo;
piVar10[1] = (int)&CBaseEntity::typeinfo;
*piVar10 = (int)piVar5;
piVar10[-1] = 0x8a610a;
piVar6 = (int *)__dynamic_cast();
if (piVar6 == (int *)0x0) {
iVar9 = param_2[1];
local_2c = 1;
}
else {
iVar9 = param_2[1];
local_2c = piVar6[0x513];
if (iVar9 == 2) {
iVar9 = *piVar6;
*piVar10 = (int)piVar6;
pcVar3 = *(code **)(iVar9 + 0x3cc);
piVar10[-1] = 0x8a62db;
local_48 = (*pcVar3)();
iVar9 = param_2[1];
}
}
if (iVar9 == 3) {
piVar10[3] = 0;
piVar10[2] = (int)&CWeaponMeleeSpawn::typeinfo;
piVar10[1] = (int)&CBaseEntity::typeinfo;
*piVar10 = (int)piVar5;
piVar10[-1] = 0x8a62a4;
iVar9 = __dynamic_cast();
if (iVar9 != 0) {
local_48 = *(int *)(iVar9 + 0x1468);
local_2c = *(int *)(iVar9 + 0x144c);
local_4c = *(int *)(iVar9 + 0x148);
}
}
iVar9 = param_2[5];
piVar10[1] = 1;
*piVar10 = (int)(param_2 + 2);
piVar10[-1] = 0x8a6146;
CUtlVector<CDirectorItemManager::ItemRestoreInfoInstance,CUtlMemory<CDirectorItemManager::ItemRestoreInfoInstance,int>>
::GrowVector((CUtlVector<CDirectorItemManager::ItemRestoreInfoInstance,CUtlMemory<CDirectorItemManager::ItemRestoreInfoInstance,int>>
*)*piVar10,piVar10[1]);
piVar10[2] = 1;
piVar10[1] = iVar9;
*piVar10 = (int)(param_2 + 2);
piVar10[-1] = 0x8a615d;
CUtlVector<CDirectorItemManager::ItemRestoreInfoInstance,CUtlMemory<CDirectorItemManager::ItemRestoreInfoInstance,int>>
::ShiftElementsRight
((CUtlVector<CDirectorItemManager::ItemRestoreInfoInstance,CUtlMemory<CDirectorItemManager::ItemRestoreInfoInstance,int>>
*)*piVar10,piVar10[1],piVar10[2]);
piVar6 = (int *)(param_2[2] + iVar9 * 0x24);
if (piVar6 != (int *)0x0) {
*piVar6 = local_3c;
piVar6[6] = local_48;
piVar6[1] = local_40;
piVar6[8] = local_4c;
piVar6[2] = local_44;
piVar6[3] = iVar8;
piVar6[4] = iVar1;
piVar6[5] = iVar2;
piVar6[7] = local_2c;
}
}
LAB_008a61b7:
piVar10[1] = (int)piVar5;
*piVar10 = (int)gEntList;
pcVar7 = "prop_physics";
if (!bVar11) {
pcVar7 = param_1;
}
piVar10[2] = (int)pcVar7;
piVar10[-1] = 0x8a61d8;
piVar5 = (int *)CGlobalEntityList::FindEntityByClassname
((CGlobalEntityList *)*piVar10,(CBaseEntity *)piVar10[1],
(char *)piVar10[2]);
piVar6 = piVar10;
} while( true );
}
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.