CUtlSortVector<CDmxAttribute*,CDmxAttributeLess>::Find
0x00be8150 · 280 bytes · __thiscall
_ZNK14CUtlSortVectorIP13CDmxAttribute17CDmxAttributeLessE4FindERKS1_
Decompiled
undefined (2 params)
/* CUtlSortVector<CDmxAttribute*, CDmxAttributeLess>::Find(CDmxAttribute* const&) const */
int __thiscall
CUtlSortVector<CDmxAttribute*,CDmxAttributeLess>::Find
(CUtlSortVector<CDmxAttribute*,CDmxAttributeLess> *this,CDmxAttribute **param_1)
{
CDmxAttribute *pCVar1;
int iVar2;
char cVar3;
int iVar4;
int iVar5;
int iVar6;
ushort uVar7;
ushort uVar8;
if ((this[0x18] != (CUtlSortVector<CDmxAttribute*,CDmxAttributeLess>)0x0) &&
(iVar5 = LoggingSystem_LogAssert
("%s (%d) : %s\n","/data/src/public/tier1/utlsortvector.h",0xd5,
"Assertion Failed: !m_bNeedsSort"), iVar5 == 1)) {
cVar3 = ShouldUseNewAssertDialog();
if ((cVar3 == '\0') ||
(cVar3 = DoNewAssertDialog("/data/src/public/tier1/utlsortvector.h",0xd5,
"Assertion Failed: !m_bNeedsSort"), cVar3 != '\0')) {
raise(5);
}
_ExitOnFatalAssert("/data/src/public/tier1/utlsortvector.h",0xd5);
}
iVar5 = *(int *)(this + 0xc) + -1;
if (-1 < iVar5) {
iVar6 = 0;
pCVar1 = *param_1;
do {
while( true ) {
iVar4 = iVar6 + iVar5 >> 1;
iVar2 = *(int *)(*(int *)this + iVar4 * 4);
if (iVar2 != 0) break;
if (pCVar1 == (CDmxAttribute *)0x0) {
return iVar4;
}
uVar8 = *(ushort *)(pCVar1 + 4);
uVar7 = 0xffff;
LAB_00be81af:
if (uVar7 <= uVar8) {
return iVar4;
}
iVar5 = iVar4 + -1;
if (iVar5 < iVar6) {
return -1;
}
}
uVar7 = *(ushort *)(iVar2 + 4);
if (pCVar1 == (CDmxAttribute *)0x0) {
uVar8 = 0xffff;
if (uVar7 != 0xffff) goto LAB_00be8180;
goto LAB_00be81af;
}
uVar8 = *(ushort *)(pCVar1 + 4);
if (uVar8 <= uVar7) goto LAB_00be81af;
LAB_00be8180:
iVar6 = iVar4 + 1;
} while (iVar6 <= iVar5);
}
return -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.