CommandNavSelectParitallyVisible
0x00979680 · 661 bytes · unknown
_Z32CommandNavSelectParitallyVisiblev
Decompiled
undefined (0 params)
/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* CommandNavSelectParitallyVisible() */
void CommandNavSelectParitallyVisible(void)
{
ushort uVar1;
CNavArea *pCVar2;
int iVar3;
char cVar4;
int iVar5;
int iVar6;
CBaseEntity *this;
int iVar7;
int iVar8;
CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>> *local_44;
CNavArea *local_3c;
CNavArea *local_38;
char local_34;
int *local_30;
undefined4 local_2c;
undefined4 local_28;
int local_24;
int *local_20;
cVar4 = UTIL_IsCommandIssuedByServerAdmin();
if ((cVar4 == '\0') || (iVar5 = CNavMesh::GetMarkedArea(TheNavMesh), iVar5 == 0)) {
return;
}
CNavMesh::ClearSelectedSet(TheNavMesh);
iVar6 = UTIL_GetListenServerHost();
if (iVar6 != 0) {
this = (CBaseEntity *)UTIL_GetListenServerHost();
CBaseEntity::EmitSound(this,"EDIT_PLACE_PICK",0.0,(float *)0x0);
}
local_30 = (int *)0x0;
TerrorNavArea::s_nCurrVisTestCounter = TerrorNavArea::s_nCurrVisTestCounter + 1;
local_2c = 0;
local_28 = 0;
local_24 = 0;
local_20 = (int *)0x0;
local_34 = '\0';
if (0 < *(int *)(iVar5 + 0x13c)) {
iVar6 = 0;
iVar7 = 0;
do {
pCVar2 = *(CNavArea **)
(TheNavAreas +
((int)(uint)*(ushort *)(*(int *)(iVar5 + 0x134) + iVar7 * 2) >> 2) * 4);
if ((pCVar2 == (CNavArea *)0x0) ||
(*(int *)(pCVar2 + 0x170) = TerrorNavArea::s_nCurrVisTestCounter,
(*(byte *)(*(int *)(iVar5 + 0x134) + iVar7 * 2) & 3) == 0)) {
LAB_00979740:
if (*(int *)(iVar5 + 0x13c) <= iVar7 + 1) goto LAB_009797e0;
}
else {
local_3c = pCVar2;
if ((local_34 != '\0') && (0 < iVar6)) {
if (pCVar2 != (CNavArea *)*local_30) {
iVar8 = 0;
do {
iVar8 = iVar8 + 1;
if (iVar8 == iVar6) goto LAB_009797b8;
} while (pCVar2 != (CNavArea *)local_30[iVar8]);
if (iVar8 < 0) goto LAB_009797b8;
}
goto LAB_00979740;
}
LAB_009797b8:
/* try { // try from 009797c9 to 009798d6 has its CatchHandler @ 0097993d */
CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>>::InsertBefore
((CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>> *)&local_30,iVar6,&local_3c);
iVar6 = local_24;
if (*(int *)(iVar5 + 0x13c) <= iVar7 + 1) goto LAB_009797e0;
}
iVar7 = iVar7 + 1;
} while( true );
}
iVar6 = 0;
LAB_009797e0:
local_44 = (CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>> *)&local_30;
iVar5 = *(int *)(iVar5 + 0x130);
if ((iVar5 != 0) && (iVar7 = 0, 0 < *(int *)(iVar5 + 0x13c))) {
do {
while( true ) {
iVar3 = TheNavAreas;
iVar8 = *(int *)(TheNavAreas +
((int)(uint)*(ushort *)(*(int *)(iVar5 + 0x134) + iVar7 * 2) >> 2) * 4);
if ((iVar8 != 0) && (*(int *)(iVar8 + 0x170) != TerrorNavArea::s_nCurrVisTestCounter))
break;
LAB_00979800:
iVar7 = iVar7 + 1;
if (*(int *)(iVar5 + 0x13c) <= iVar7) goto LAB_009798b0;
}
*(int *)(iVar8 + 0x170) = TerrorNavArea::s_nCurrVisTestCounter;
uVar1 = *(ushort *)(*(int *)(iVar5 + 0x134) + iVar7 * 2);
if ((uVar1 & 3) == 0) goto LAB_00979800;
local_38 = *(CNavArea **)((uVar1 & 0xfffc) + iVar3);
if ((local_34 != '\0') && (0 < iVar6)) {
if (local_38 != (CNavArea *)*local_30) {
iVar8 = 0;
do {
iVar8 = iVar8 + 1;
if (iVar8 == iVar6) goto LAB_00979888;
} while (local_38 != (CNavArea *)local_30[iVar8]);
if (iVar8 < 0) goto LAB_00979888;
}
goto LAB_00979800;
}
LAB_00979888:
CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>>::InsertBefore(local_44,iVar6,&local_38);
iVar7 = iVar7 + 1;
iVar6 = local_24;
} while (iVar7 < *(int *)(iVar5 + 0x13c));
}
LAB_009798b0:
iVar5 = 0;
if (0 < iVar6) {
do {
CNavMesh::AddToSelectedSet(TheNavMesh,(CNavArea *)local_30[iVar5]);
iVar5 = iVar5 + 1;
} while (iVar5 < local_24);
}
local_24 = 0;
CUtlMemory<CNavArea*,int>::Purge((CUtlMemory<CNavArea*,int> *)local_44);
local_20 = local_30;
CUtlMemory<CNavArea*,int>::Purge((CUtlMemory<CNavArea*,int> *)local_44);
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.