COverlayMgr::GetMaterialSortID
0x001d4350 · 183 bytes · __thiscall
_ZN11COverlayMgr17GetMaterialSortIDEP9IMateriali
Decompiled
undefined (3 params)
/* COverlayMgr::GetMaterialSortID(IMaterial*, int) */
uint __thiscall COverlayMgr::GetMaterialSortID(COverlayMgr *this,IMaterial *param_1,int param_2)
{
ushort uVar1;
uint uVar2;
int iVar3;
int *piVar4;
undefined4 *puVar5;
uVar1 = *(ushort *)(this + 0x18);
if (uVar1 != 0xffff) {
do {
piVar4 = (int *)((uint)uVar1 * 0x30 + *(int *)(this + 0xc));
if (((IMaterial *)*piVar4 == param_1) && (piVar4[1] == param_2)) {
*(short *)(piVar4 + 10) = (short)piVar4[10] + 1;
return (uint)uVar1;
}
uVar1 = *(ushort *)((int)piVar4 + 0x2e);
} while (uVar1 != 0xffff);
}
uVar2 = CUtlLinkedList<COverlayMgr::RenderQueueHead_t,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<COverlayMgr::RenderQueueHead_t,unsigned_short>,unsigned_short>>
::InsertBefore((CUtlLinkedList<COverlayMgr::RenderQueueHead_t,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<COverlayMgr::RenderQueueHead_t,unsigned_short>,unsigned_short>>
*)(this + 0xc),0xffff);
puVar5 = (undefined4 *)((uVar2 & 0xffff) * 0x30 + *(int *)(this + 0xc));
*(undefined2 *)(puVar5 + 10) = 1;
iVar3 = 0;
*puVar5 = param_1;
puVar5[1] = param_2;
do {
iVar3 = iVar3 + 1;
*(undefined2 *)(puVar5 + 2) = 0xffff;
*(undefined2 *)((int)puVar5 + 10) = 0xffff;
*(undefined2 *)(puVar5 + 3) = 0;
*(undefined2 *)((int)puVar5 + 0xe) = 0;
puVar5 = puVar5 + 2;
} while (iVar3 != 4);
(**(code **)(*(int *)param_1 + 0x30))(param_1);
return uVar2 & 0xffff;
}
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.