TerrorEditMarkAttribute
0x00972ce0 · 569 bytes · __cdecl
_Z23TerrorEditMarkAttributeRK8CCommand
Decompiled
undefined (1 param)
/* TerrorEditMarkAttribute(CCommand const&) */
void TerrorEditMarkAttribute(CCommand *param_1)
{
int iVar1;
uint uVar2;
CNavMesh *pCVar3;
char cVar4;
undefined1 *puVar5;
uint uVar6;
char *pcVar7;
int iVar8;
int iVar9;
int local_20 [4];
cVar4 = CNavMesh::TestFilesWritable(TheNavMesh);
if (cVar4 != '\0') {
if (*(int *)param_1 < 2) {
if (*(int *)param_1 == 1) {
puVar5 = *(undefined1 **)(param_1 + 0x408);
}
else {
puVar5 = &DAT_00d539c2;
}
Msg("Usage: %s <attribute> [attribute2...]\n",puVar5);
return;
}
iVar9 = 1;
do {
while( true ) {
uVar6 = NameToSpawnAttribute(*(char **)(param_1 + iVar9 * 4 + 0x408));
pcVar7 = "";
if (iVar9 < *(int *)param_1) {
pcVar7 = *(char **)(param_1 + iVar9 * 4 + 0x408);
}
iVar8 = NameToNavAttribute(pcVar7);
pCVar3 = TheNavMesh;
if (uVar6 != 0) break;
if (iVar8 == 0) {
puVar5 = &DAT_00d539c2;
if (iVar9 < *(int *)param_1) {
puVar5 = *(undefined1 **)(param_1 + iVar9 * 4 + 0x408);
}
Msg("Unknown attribute \'%s\'",puVar5);
}
else {
local_20[0] = iVar8;
cVar4 = CNavMesh::IsSelectedSetEmpty(TheNavMesh);
if (cVar4 == '\0') {
iVar8 = 0;
if (0 < *(int *)(pCVar3 + 0x4e0)) {
do {
cVar4 = NavAttributeToggler::operator()
((NavAttributeToggler *)local_20,
*(CNavArea **)(*(int *)(pCVar3 + 0x4d4) + iVar8 * 4));
if (cVar4 == '\0') break;
iVar8 = iVar8 + 1;
} while (iVar8 < *(int *)(pCVar3 + 0x4e0));
}
}
else if (*(CNavArea **)(pCVar3 + 0x474) != (CNavArea *)0x0) {
NavAttributeToggler::operator()
((NavAttributeToggler *)local_20,*(CNavArea **)(pCVar3 + 0x474));
}
}
LAB_00972d40:
iVar9 = iVar9 + 1;
if (*(int *)param_1 <= iVar9) {
return;
}
}
cVar4 = CNavMesh::IsSelectedSetEmpty(TheNavMesh);
if (cVar4 != '\0') {
iVar8 = *(int *)(pCVar3 + 0x474);
if (iVar8 != 0) {
cVar4 = CNavMesh::IsSelectedSetEmpty(TheNavMesh);
uVar2 = *(uint *)(iVar8 + 300);
if ((cVar4 == '\0') || ((uVar6 & uVar2) == 0)) {
*(uint *)(iVar8 + 300) = uVar2 | uVar6;
}
else {
*(uint *)(iVar8 + 300) = ~uVar6 & uVar2;
}
}
goto LAB_00972d40;
}
iVar8 = 0;
if (*(int *)(pCVar3 + 0x4e0) < 1) goto LAB_00972d40;
do {
while( true ) {
iVar1 = *(int *)(*(int *)(pCVar3 + 0x4d4) + iVar8 * 4);
cVar4 = CNavMesh::IsSelectedSetEmpty(TheNavMesh);
uVar2 = *(uint *)(iVar1 + 300);
if ((cVar4 != '\0') && ((uVar6 & uVar2) != 0)) break;
iVar8 = iVar8 + 1;
*(uint *)(iVar1 + 300) = uVar2 | uVar6;
if (*(int *)(pCVar3 + 0x4e0) <= iVar8) goto LAB_00972e05;
}
iVar8 = iVar8 + 1;
*(uint *)(iVar1 + 300) = uVar2 & ~uVar6;
} while (iVar8 < *(int *)(pCVar3 + 0x4e0));
LAB_00972e05:
iVar9 = iVar9 + 1;
} while (iVar9 < *(int *)param_1);
}
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.