scan_tree
0x000eb260 · 267 bytes · __cdecl
_Z9scan_treeR6TStateP7ct_datai
Decompiled
undefined (3 params)
/* scan_tree(TState&, ct_data*, int) */
void scan_tree(TState *param_1,ct_data *param_2,int param_3)
{
ct_data *pcVar1;
int iVar2;
uint uVar3;
uint uVar4;
int iVar5;
int iVar6;
uint local_18;
uVar3 = (uint)*(ushort *)(param_2 + 2);
*(undefined2 *)(param_2 + param_3 * 4 + 6) = 0xffff;
iVar6 = 4 - (uint)(uVar3 == 0);
iVar5 = (-(uint)(uVar3 == 0) & 0x83) + 7;
if (-1 < param_3) {
pcVar1 = param_2 + param_3 * 4 + 4;
local_18 = 0xffffffff;
iVar2 = 0;
while( true ) {
iVar2 = iVar2 + 1;
uVar4 = (uint)*(ushort *)(param_2 + 6);
if ((iVar5 <= iVar2) || (uVar3 != uVar4)) {
if (iVar2 < iVar6) {
*(short *)(param_1 + uVar3 * 4 + 0xef4) =
*(short *)(param_1 + uVar3 * 4 + 0xef4) + (short)iVar2;
}
else if (uVar3 == 0) {
if (iVar2 < 0xb) {
*(short *)(param_1 + 0xf38) = *(short *)(param_1 + 0xf38) + 1;
}
else {
*(short *)(param_1 + 0xf3c) = *(short *)(param_1 + 0xf3c) + 1;
}
}
else {
if (local_18 != uVar3) {
*(short *)(param_1 + uVar3 * 4 + 0xef4) = *(short *)(param_1 + uVar3 * 4 + 0xef4) + 1;
}
*(short *)(param_1 + 0xf34) = *(short *)(param_1 + 0xf34) + 1;
}
local_18 = uVar3;
if (uVar4 == 0) {
iVar2 = 0;
iVar6 = 3;
iVar5 = 0x8a;
}
else if (uVar3 == uVar4) {
iVar6 = 3;
iVar5 = 6;
iVar2 = 0;
local_18 = uVar4;
}
else {
iVar6 = 4;
iVar5 = 7;
iVar2 = 0;
}
}
if (param_2 + 4 == pcVar1) break;
param_2 = param_2 + 4;
uVar3 = uVar4;
}
}
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.