TerrorEditClearAttribute
0x009728c0 · 385 bytes · __cdecl
_Z24TerrorEditClearAttributeRK8CCommand
Decompiled
undefined (1 param)
/* TerrorEditClearAttribute(CCommand const&) */
void TerrorEditClearAttribute(CCommand *param_1)
{
uint *puVar1;
int iVar2;
CNavMesh *pCVar3;
char cVar4;
uint uVar5;
char *pcVar6;
uint uVar7;
undefined1 *puVar8;
int iVar9;
int iVar10;
iVar10 = 1;
if (*(int *)param_1 < 2) {
if (*(int *)param_1 == 1) {
puVar8 = *(undefined1 **)(param_1 + 0x408);
}
else {
puVar8 = &DAT_00d539c2;
}
Msg("Usage: %s <attribute1> [attribute2...]\n",puVar8);
return;
}
do {
while( true ) {
uVar5 = NameToSpawnAttribute(*(char **)(param_1 + iVar10 * 4 + 0x408));
pcVar6 = "";
if (iVar10 < *(int *)param_1) {
pcVar6 = *(char **)(param_1 + iVar10 * 4 + 0x408);
}
uVar7 = NameToNavAttribute(pcVar6);
pCVar3 = TheNavMesh;
if (uVar5 != 0) break;
if (uVar7 == 0) {
puVar8 = &DAT_00d539c2;
if (iVar10 < *(int *)param_1) {
puVar8 = *(undefined1 **)(param_1 + iVar10 * 4 + 0x408);
}
Msg("Unknown attribute \'%s\'",puVar8);
}
else {
cVar4 = CNavMesh::IsSelectedSetEmpty(TheNavMesh);
if (cVar4 == '\0') {
iVar9 = 0;
if (0 < *(int *)(pCVar3 + 0x4e0)) {
do {
iVar2 = iVar9 * 4;
iVar9 = iVar9 + 1;
puVar1 = (uint *)(*(int *)(*(int *)(pCVar3 + 0x4d4) + iVar2) + 0x54);
*puVar1 = *puVar1 & ~uVar7;
} while (iVar9 < *(int *)(pCVar3 + 0x4e0));
}
}
else if (*(int *)(pCVar3 + 0x474) != 0) {
puVar1 = (uint *)(*(int *)(pCVar3 + 0x474) + 0x54);
*puVar1 = *puVar1 & ~uVar7;
}
}
LAB_00972909:
iVar10 = iVar10 + 1;
if (*(int *)param_1 <= iVar10) {
return;
}
}
cVar4 = CNavMesh::IsSelectedSetEmpty(TheNavMesh);
if (cVar4 != '\0') {
if (*(int *)(pCVar3 + 0x474) != 0) {
puVar1 = (uint *)(*(int *)(pCVar3 + 0x474) + 300);
*puVar1 = *puVar1 & ~uVar5;
}
goto LAB_00972909;
}
iVar9 = 0;
if (*(int *)(pCVar3 + 0x4e0) < 1) goto LAB_00972909;
do {
iVar2 = iVar9 * 4;
iVar9 = iVar9 + 1;
puVar1 = (uint *)(*(int *)(*(int *)(pCVar3 + 0x4d4) + iVar2) + 300);
*puVar1 = *puVar1 & ~uVar5;
} while (iVar9 < *(int *)(pCVar3 + 0x4e0));
iVar10 = iVar10 + 1;
if (*(int *)param_1 <= iVar10) {
return;
}
} while( true );
}
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.