SendTable_SortByPriority
0x00142980 · 607 bytes · __cdecl
_Z24SendTable_SortByPriorityP21CBuildHierarchyStruct
Decompiled
undefined (1 param)
/* SendTable_SortByPriority(CBuildHierarchyStruct*) */
void SendTable_SortByPriority(CBuildHierarchyStruct *param_1)
{
uchar *puVar1;
uchar uVar2;
uchar *puVar3;
int iVar4;
uchar *puVar5;
int iVar6;
int iVar7;
CBuildHierarchyStruct CVar8;
int iVar9;
uint uVar10;
int iVar11;
int iVar12;
uchar *local_50;
uchar local_31;
uchar *local_30;
undefined4 local_2c;
undefined4 local_28;
int local_24;
uchar *local_20;
local_30 = (uchar *)0x0;
local_2c = 0;
local_28 = 0;
local_24 = 0;
local_20 = (uchar *)0x0;
local_31 = '@';
/* try { // try from 001429c8 to 00142a28 has its CatchHandler @ 00142bee */
CUtlVector<unsigned_char,CUtlMemory<unsigned_char,int>>::InsertBefore
((CUtlVector<unsigned_char,CUtlMemory<unsigned_char,int>> *)&local_30,0,&local_31);
iVar12 = 0;
iVar9 = local_24;
if (0 < *(int *)(param_1 + 0x9004)) {
do {
uVar2 = *(uchar *)(*(int *)(param_1 + iVar12 * 4 + 0x4008) + 0x38);
if (iVar9 < 1) {
LAB_00142a10:
local_31 = uVar2;
CUtlVector<unsigned_char,CUtlMemory<unsigned_char,int>>::InsertBefore
((CUtlVector<unsigned_char,CUtlMemory<unsigned_char,int>> *)&local_30,iVar9,
&local_31);
iVar9 = local_24;
}
else if (uVar2 != *local_30) {
iVar4 = 0;
do {
iVar4 = iVar4 + 1;
if (iVar4 == iVar9) goto LAB_00142a10;
} while (uVar2 != local_30[iVar4]);
if (iVar4 < 0) goto LAB_00142a10;
}
iVar12 = iVar12 + 1;
} while (iVar12 < *(int *)(param_1 + 0x9004));
}
puVar3 = local_30;
puVar1 = local_30 + iVar9;
uVar10 = (int)puVar1 - (int)local_30;
if (0 < (int)uVar10) {
do {
puVar5 = operator_new(uVar10,(nothrow_t *)&std::nothrow);
if (puVar5 != (uchar *)0x0) {
std::__stable_sort_adaptive<unsigned_char*,unsigned_char*,int>(puVar3,puVar1,puVar5,uVar10);
goto LAB_00142a8b;
}
uVar10 = (int)uVar10 >> 1;
} while (uVar10 != 0);
}
std::__inplace_stable_sort<unsigned_char*>(puVar3,puVar1);
puVar5 = (uchar *)0x0;
LAB_00142a8b:
operator_delete(puVar5,(nothrow_t *)&std::nothrow);
if (0 < local_24) {
iVar9 = *(int *)(param_1 + 0x9004);
local_50 = local_30;
iVar12 = 0;
LAB_00142ac0:
do {
uVar2 = *local_50;
do {
for (; iVar12 < iVar9; iVar12 = iVar12 + 1) {
iVar4 = *(int *)(param_1 + iVar12 * 4 + 0x4008);
CVar8 = param_1[iVar12 + 0x8004];
iVar6 = iVar12;
iVar11 = iVar4;
if (uVar2 != *(uchar *)(iVar4 + 0x38)) {
do {
if (((*(byte *)(iVar11 + 0x3e) & 4) != 0) && (iVar7 = iVar6, uVar2 == '@')) break;
iVar7 = iVar6 + 1;
if (iVar7 == iVar9) {
local_50 = local_50 + 1;
if (local_50 == local_30 + local_24) goto LAB_00142b7f;
goto LAB_00142ac0;
}
iVar11 = *(int *)(param_1 + iVar7 * 4 + 0x4008);
CVar8 = param_1[iVar6 + 0x8005];
iVar6 = iVar7;
} while (uVar2 != *(uchar *)(iVar11 + 0x38));
if (iVar12 != iVar7) {
*(int *)(param_1 + iVar7 * 4 + 0x4008) = iVar4;
param_1[iVar7 + 0x8004] = param_1[iVar12 + 0x8004];
*(int *)(param_1 + iVar12 * 4 + 0x4008) = iVar11;
param_1[iVar12 + 0x8004] = CVar8;
}
}
}
} while (iVar12 != iVar9);
local_50 = local_50 + 1;
} while (local_50 != local_30 + local_24);
}
LAB_00142b7f:
local_24 = 0;
CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)&local_30);
local_20 = local_30;
CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)&local_30);
return;
}
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.