TerrorNavMesh::LoadCustomDataPreArea
0x00993360 · 812 bytes · __thiscall
_ZN13TerrorNavMesh21LoadCustomDataPreAreaER10CUtlBufferj
Decompiled
undefined (3 params)
/* TerrorNavMesh::LoadCustomDataPreArea(CUtlBuffer&, unsigned int) */
void __thiscall
TerrorNavMesh::LoadCustomDataPreArea(TerrorNavMesh *this,CUtlBuffer *param_1,uint param_2)
{
ushort uVar1;
undefined2 uVar2;
char cVar3;
uint uVar4;
ushort *puVar5;
undefined2 *puVar6;
ushort uVar7;
int iVar8;
int iVar9;
int in_GS_OFFSET;
ushort local_128;
undefined2 local_126;
undefined4 local_124;
char local_120 [256];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (param_2 < 8) goto LAB_009934e0;
if (param_2 < 0xc) {
ConVar::Revert((ConVar *)ZombiePopulation);
if (((byte)param_1[0x15] & 1) == 0) goto LAB_0099352f;
LAB_009933a6:
local_126 = 0;
CUtlBuffer::Scanf(param_1,"%u",&local_126);
uVar1 = local_126;
}
else {
CUtlBuffer::GetString(param_1,local_120,0x40);
ConVar::SetValue(ZombiePopulation);
if (((byte)param_1[0x15] & 1) != 0) goto LAB_009933a6;
LAB_0099352f:
cVar3 = CUtlBuffer::CheckGet(param_1,2);
if (cVar3 == '\0') {
DAT_01016a64 = 0;
goto LAB_009934e0;
}
if (((byte)param_1[0x34] & 1) == 0) {
iVar9 = *(int *)(param_1 + 0xc);
uVar1 = *(ushort *)(*(int *)param_1 + (iVar9 - *(int *)(param_1 + 0x20)));
}
else {
puVar6 = (undefined2 *)
((*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (puVar6 == (undefined2 *)0x0) {
puVar6 = &local_126;
}
uVar2 = local_124._2_2_;
local_124 = CONCAT22(local_124._2_2_,local_126);
local_124 = CONCAT31(local_124._1_3_,*(undefined1 *)((int)puVar6 + 1));
local_124 = CONCAT22(uVar2,CONCAT11(*(undefined1 *)puVar6,*(undefined1 *)((int)puVar6 + 1)));
_V_memcpy(&local_126,&local_124,2);
iVar9 = *(int *)(param_1 + 0xc);
uVar1 = local_126;
}
*(int *)(param_1 + 0xc) = iVar9 + 2;
}
DAT_01016a64 = 0;
if (uVar1 != 0) {
iVar9 = 0;
do {
if (((byte)param_1[0x15] & 1) == 0) {
cVar3 = CUtlBuffer::CheckGet(param_1,2);
if (cVar3 == '\0') break;
if (((byte)param_1[0x34] & 1) == 0) {
iVar8 = *(int *)(param_1 + 0xc);
uVar7 = *(ushort *)(*(int *)param_1 + (iVar8 - *(int *)(param_1 + 0x20)));
}
else {
puVar5 = (ushort *)
((*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (puVar5 == (ushort *)0x0) {
puVar5 = &local_128;
}
local_126 = local_128;
local_126 = CONCAT11((char)(local_128 >> 8),*(undefined1 *)((int)puVar5 + 1));
local_126 = CONCAT11((char)*puVar5,*(undefined1 *)((int)puVar5 + 1));
_V_memcpy(&local_128,&local_126,2);
iVar8 = *(int *)(param_1 + 0xc);
uVar7 = local_128;
}
*(int *)(param_1 + 0xc) = iVar8 + 2;
}
else {
local_128 = 0;
CUtlBuffer::Scanf(param_1,"%u",&local_128);
uVar7 = local_128;
}
iVar8 = 0xff;
uVar4 = 0x100;
if (uVar7 < 0x100) {
if (uVar7 == 0) break;
uVar4 = (uint)uVar7;
iVar8 = uVar4 - 1;
}
CUtlBuffer::Get(param_1,local_120,uVar4);
local_120[iVar8] = '\0';
local_124 = NameToFogPlace(TheNavMesh,local_120);
if (local_124 != 0) {
if (DAT_01016a64 < 1) {
LAB_009934b0:
CUtlVector<unsigned_int,CUtlMemory<unsigned_int,int>>::InsertBefore
((CUtlVector<unsigned_int,CUtlMemory<unsigned_int,int>> *)&fogPlaceDirectory,
DAT_01016a64,&local_124);
}
else if (local_124 != *fogPlaceDirectory) {
iVar8 = 0;
do {
iVar8 = iVar8 + 1;
if (iVar8 == DAT_01016a64) goto LAB_009934b0;
} while (local_124 != fogPlaceDirectory[iVar8]);
if (iVar8 < 0) goto LAB_009934b0;
}
}
iVar9 = iVar9 + 1;
} while (iVar9 < (int)(uint)uVar1);
}
LAB_009934e0:
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.