TerrorNavMesh::SaveCustomDataPreArea
0x00993090 · 669 bytes · __thiscall
_ZNK13TerrorNavMesh21SaveCustomDataPreAreaER10CUtlBuffer
Decompiled
undefined (2 params)
/* TerrorNavMesh::SaveCustomDataPreArea(CUtlBuffer&) const */
void __thiscall TerrorNavMesh::SaveCustomDataPreArea(TerrorNavMesh *this,CUtlBuffer *param_1)
{
uint uVar1;
char cVar2;
uint uVar3;
char *pcVar4;
size_t sVar5;
undefined2 uVar6;
void *pvVar7;
int iVar8;
uint uVar9;
int local_30;
undefined1 local_26;
undefined1 uStack_25;
undefined1 local_24;
undefined1 uStack_23;
undefined1 local_22;
undefined1 local_21;
uint local_20 [4];
pcVar4 = "FCVAR_NEVER_AS_STRING";
if ((ZombiePopulation[0x15] & 0x10) == 0) {
pcVar4 = "";
if (*(char **)(ZombiePopulation._28_4_ + 0x24) != (char *)0x0) {
pcVar4 = *(char **)(ZombiePopulation._28_4_ + 0x24);
}
}
CUtlBuffer::PutString(param_1,pcVar4);
DAT_01016a64 = 0;
if (DAT_00fe6000 < 1) {
uVar9 = 0;
}
else {
iVar8 = 0;
uVar9 = 0;
do {
while (uVar1 = *(uint *)(*(int *)(TheNavAreas + iVar8 * 4) + 0x160), uVar1 == 0) {
LAB_009930f0:
iVar8 = iVar8 + 1;
if (DAT_00fe6000 <= iVar8) goto LAB_00993160;
}
local_20[0] = uVar1;
if (0 < (int)uVar9) {
if (uVar1 != *fogPlaceDirectory) {
uVar3 = 0;
do {
uVar3 = uVar3 + 1;
if (uVar3 == uVar9) goto LAB_00993138;
} while (uVar1 != fogPlaceDirectory[uVar3]);
if ((int)uVar3 < 0) goto LAB_00993138;
}
goto LAB_009930f0;
}
LAB_00993138:
iVar8 = iVar8 + 1;
CUtlVector<unsigned_int,CUtlMemory<unsigned_int,int>>::InsertBefore
((CUtlVector<unsigned_int,CUtlMemory<unsigned_int,int>> *)&fogPlaceDirectory,uVar9,
local_20);
uVar9 = DAT_01016a64;
} while (iVar8 < DAT_00fe6000);
LAB_00993160:
uVar9 = uVar9 & 0xffff;
}
if (((byte)param_1[0x15] & 1) == 0) {
cVar2 = CUtlBuffer::CheckPut(param_1,2);
if (cVar2 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
*(short *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) =
(short)uVar9;
iVar8 = *(int *)(param_1 + 0x10);
}
else {
iVar8 = *(int *)(param_1 + 0x10);
pvVar7 = (void *)((iVar8 - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (pvVar7 != (void *)0x0) {
uStack_25 = (undefined1)(uVar9 >> 8);
local_22 = uStack_25;
local_26 = (undefined1)uVar9;
local_21 = local_26;
_V_memcpy(pvVar7,&local_22,2);
iVar8 = *(int *)(param_1 + 0x10);
}
}
*(int *)(param_1 + 0x10) = iVar8 + 2;
CUtlBuffer::AddNullTermination(param_1);
}
}
else {
CUtlBuffer::Printf(param_1,"%u",uVar9);
}
if (0 < (int)DAT_01016a64) {
local_30 = 0;
do {
pcVar4 = (char *)FogPlaceToName(TheNavMesh,fogPlaceDirectory[local_30]);
if (pcVar4 == (char *)0x0) {
uVar9 = 1;
uVar6 = 1;
pcVar4 = "";
}
else {
sVar5 = strlen(pcVar4);
uVar6 = (undefined2)(sVar5 + 1);
uVar9 = sVar5 + 1 & 0xffff;
}
if (((byte)param_1[0x15] & 1) == 0) {
cVar2 = CUtlBuffer::CheckPut(param_1,2);
if (cVar2 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
*(undefined2 *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20)))
= uVar6;
iVar8 = *(int *)(param_1 + 0x10);
}
else {
iVar8 = *(int *)(param_1 + 0x10);
pvVar7 = (void *)((iVar8 - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (pvVar7 != (void *)0x0) {
uStack_23 = (undefined1)((ushort)uVar6 >> 8);
local_22 = uStack_23;
local_24 = (undefined1)uVar6;
local_21 = local_24;
_V_memcpy(pvVar7,&local_22,2);
iVar8 = *(int *)(param_1 + 0x10);
}
}
*(int *)(param_1 + 0x10) = iVar8 + 2;
CUtlBuffer::AddNullTermination(param_1);
}
}
else {
CUtlBuffer::Printf(param_1,"%u",uVar9);
}
CUtlBuffer::Put(param_1,pcVar4,uVar9);
local_30 = local_30 + 1;
} while (local_30 < (int)DAT_01016a64);
}
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.