TerrorEditSelectWithAttribute
0x00971b60 · 340 bytes · __cdecl
_Z29TerrorEditSelectWithAttributeRK8CCommand
Decompiled
undefined (1 param)
/* TerrorEditSelectWithAttribute(CCommand const&) */
void TerrorEditSelectWithAttribute(CCommand *param_1)
{
CNavArea *pCVar1;
uint uVar2;
char *pcVar3;
undefined1 *puVar4;
int iVar5;
int iVar6;
CNavMesh::ClearSelectedSet(TheNavMesh);
if (*(int *)param_1 != 2) {
if (*(int *)param_1 < 1) {
puVar4 = &DAT_00d539c2;
}
else {
puVar4 = *(undefined1 **)(param_1 + 0x408);
}
Msg("Usage: %s <attribute>\n",puVar4);
return;
}
uVar2 = NameToSpawnAttribute(*(char **)(param_1 + 0x40c));
if (uVar2 == 0) {
pcVar3 = "";
if (1 < *(int *)param_1) {
pcVar3 = *(char **)(param_1 + 0x40c);
}
uVar2 = NameToNavAttribute(pcVar3);
if (uVar2 == 0) {
puVar4 = &DAT_00d539c2;
if (1 < *(int *)param_1) {
puVar4 = *(undefined1 **)(param_1 + 0x40c);
}
Msg("Unknown attribute \'%s\'",puVar4);
}
else if (0 < DAT_00fe6000) {
iVar5 = 0;
iVar6 = 0;
do {
pCVar1 = *(CNavArea **)(TheNavAreas + iVar5 * 4);
if ((*(uint *)(pCVar1 + 0x54) & uVar2) != 0) {
iVar6 = iVar6 + 1;
CNavMesh::AddToSelectedSet(TheNavMesh,pCVar1);
}
iVar5 = iVar5 + 1;
} while (iVar5 < DAT_00fe6000);
goto LAB_00971c88;
}
}
else {
iVar5 = 0;
iVar6 = 0;
if (0 < DAT_00fe6000) {
do {
while (pCVar1 = *(CNavArea **)(TheNavAreas + iVar5 * 4),
(*(uint *)(pCVar1 + 300) & uVar2) == 0) {
iVar5 = iVar5 + 1;
if (DAT_00fe6000 <= iVar5) goto LAB_00971c88;
}
iVar5 = iVar5 + 1;
iVar6 = iVar6 + 1;
CNavMesh::AddToSelectedSet(TheNavMesh,pCVar1);
} while (iVar5 < DAT_00fe6000);
goto LAB_00971c88;
}
}
iVar6 = 0;
LAB_00971c88:
Msg("%d areas added to selection\n",iVar6);
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.