CNavMesh::GetCachedOrLoadNavData
0x0071bc10 · 522 bytes · __thiscall
_ZN8CNavMesh22GetCachedOrLoadNavDataEPiPb
Decompiled
undefined (3 params)
/* CNavMesh::GetCachedOrLoadNavData(int*, bool*) */
undefined4 __thiscall CNavMesh::GetCachedOrLoadNavData(CNavMesh *this,int *param_1,bool *param_2)
{
char cVar1;
undefined1 *puVar2;
char *pcVar3;
int iVar4;
void *__ptr;
undefined4 uVar5;
int in_GS_OFFSET;
undefined4 local_158;
undefined4 local_154;
undefined4 local_14c;
undefined4 local_148;
undefined1 local_144;
undefined4 local_13c;
undefined4 local_138;
char local_120 [256];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
puVar2 = &DAT_00d539c2;
if (*(undefined1 **)(gpGlobals + 0x3c) != (undefined1 *)0x0) {
puVar2 = *(undefined1 **)(gpGlobals + 0x3c);
}
V_snprintf(local_120,0x100,"maps\\%s.nav",puVar2);
V_FixSlashes(local_120,'/');
__ptr = (void *)0x0;
if (*(int *)(this + 0x5d8) != 0) {
pcVar3 = (char *)CUtlString::Get((CUtlString *)(this + 0x5dc));
iVar4 = _V_stricmp(local_120,pcVar3);
if (iVar4 == 0) {
*param_2 = (bool)this[0x5f0];
*param_1 = *(int *)(this + 0x5ec);
uVar5 = *(undefined4 *)(this + 0x5d8);
goto LAB_0071bccb;
}
__ptr = *(void **)(this + 0x5d8);
}
free(__ptr);
*(undefined4 *)(this + 0x5d8) = 0;
CUtlString::operator=((CUtlString *)(this + 0x5dc),local_120);
CUtlBuffer::CUtlBuffer((CUtlBuffer *)&local_158,0x1000,0x100000,8);
/* try { // try from 0071bd70 to 0071bdde has its CatchHandler @ 0071be25 */
cVar1 = (**(code **)(*(int *)(filesystem + 4) + 0x38))
(filesystem + 4,local_120,"GAME",(CUtlBuffer *)&local_158,0,0,0);
uVar5 = local_158;
if (cVar1 == '\0') {
uVar5 = 0;
}
else {
this[0x5f0] = (CNavMesh)0x0;
local_154 = 0;
local_158 = 0;
local_14c = 0;
*(undefined4 *)(this + 0x5ec) = local_148;
local_148 = 0;
local_144 = 0;
local_138 = 0;
local_13c = 0xffffffff;
CUtlBuffer::AddNullTermination((CUtlBuffer *)&local_158);
*(undefined4 *)(this + 0x5d8) = uVar5;
*param_2 = (bool)this[0x5f0];
*param_1 = *(int *)(this + 0x5ec);
uVar5 = *(undefined4 *)(this + 0x5d8);
}
CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)&local_158);
LAB_0071bccb:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return uVar5;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.