CNavMesh::CreateNavArea
0x0070e210 · 1064 bytes · __thiscall
_ZN8CNavMesh13CreateNavAreaERK6VectorS2_
Decompiled
undefined (3 params)
/* CNavMesh::CreateNavArea(Vector const&, Vector const&) */
CNavArea * __thiscall CNavMesh::CreateNavArea(CNavMesh *this,Vector *param_1,Vector *param_2)
{
int iVar1;
CNavArea *pCVar2;
undefined4 uVar3;
CNavArea *pCVar4;
CNavArea *local_44;
float local_40;
float local_3c;
float local_38;
float local_34;
float local_30;
float local_2c;
float local_28;
float local_24;
local_40 = *(float *)param_2;
local_3c = *(float *)(param_2 + 4);
local_38 = *(float *)(param_1 + 8);
iVar1 = GetMarkedArea(this);
if (iVar1 == 0) {
local_34 = *(float *)param_2;
local_30 = *(float *)(param_2 + 4);
local_2c = *(float *)(param_2 + 8) + 35.5;
iVar1 = GetNearestNavArea(TheNavMesh,(Vector *)&local_34,false,10000.0,true,true,false);
if (iVar1 == 0) {
local_34 = local_40;
local_30 = local_3c;
local_2c = local_38 + 35.5;
iVar1 = GetNearestNavArea(TheNavMesh,(Vector *)&local_34,false,10000.0,true,true,false);
if (iVar1 == 0) {
iVar1 = GetNearestNavArea(TheNavMesh,param_2,false,10000.0,false,true,false);
if (iVar1 == 0) {
iVar1 = GetNearestNavArea(TheNavMesh,(Vector *)&local_40,false,10000.0,false,true,false);
}
}
}
}
pCVar2 = (CNavArea *)(**(code **)(*(int *)this + 0x14))(this);
local_44 = pCVar2;
if (pCVar2 == (CNavArea *)0x0) {
Warning("NavEndArea: Out of memory\n");
}
else {
CNavArea::Build(pCVar2,param_1,(Vector *)&local_40);
if (iVar1 != 0) {
(**(code **)(*(int *)local_44 + 0x78))(local_44,iVar1,0);
}
uVar3 = CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>>::InsertBefore
((CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>> *)&TheNavAreas,DAT_00fe6000,
&local_44);
*(undefined4 *)(local_44 + 0x90) = uVar3;
AddNavArea(TheNavMesh,local_44);
if (*(int *)(nav_create_place_on_ground._28_4_ + 0x30) != 0) {
CNavArea::PlaceOnGround(local_44,4,0);
}
iVar1 = GetMarkedArea(this);
if (iVar1 != 0) {
pCVar2 = (CNavArea *)GetMarkedArea(this);
CNavArea::GetExtent(pCVar2,(Extent *)&local_34);
pCVar2 = local_44;
if ((*(float *)param_1 <= local_28) || (*(float *)param_2 <= local_28)) {
if ((local_34 <= *(float *)param_1) ||
(local_34 < *(float *)param_2 || local_34 == *(float *)param_2)) {
if ((*(float *)(param_1 + 4) <= local_24) || (*(float *)(param_2 + 4) <= local_24)) {
if ((*(float *)(param_1 + 4) < local_30) &&
(*(float *)(param_2 + 4) <= local_30 && local_30 != *(float *)(param_2 + 4))) {
pCVar4 = (CNavArea *)GetMarkedArea(this);
CNavArea::ConnectTo(pCVar4,pCVar2,0);
uVar3 = GetMarkedArea(this);
CNavArea::ConnectTo(local_44,uVar3,2);
}
}
else {
pCVar4 = (CNavArea *)GetMarkedArea(this);
CNavArea::ConnectTo(pCVar4,pCVar2,2);
uVar3 = GetMarkedArea(this);
CNavArea::ConnectTo(local_44,uVar3,0);
}
}
else {
pCVar4 = (CNavArea *)GetMarkedArea(this);
CNavArea::ConnectTo(pCVar4,pCVar2,3);
uVar3 = GetMarkedArea(this);
CNavArea::ConnectTo(local_44,uVar3,1);
}
}
else {
pCVar4 = (CNavArea *)GetMarkedArea(this);
CNavArea::ConnectTo(pCVar4,pCVar2,1);
uVar3 = GetMarkedArea(this);
CNavArea::ConnectTo(local_44,uVar3,3);
}
*(undefined4 *)(this + 0x4c4) = 0;
*(undefined4 *)(this + 0x47c) = 4;
*(CNavArea **)(this + 0x470) = local_44;
}
(**(code **)(*(int *)TheNavMesh + 0x6c))(TheNavMesh,local_44);
pCVar2 = local_44;
}
return pCVar2;
}
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.