rescue_update_nav
0x0096c000 · 732 bytes · __cdecl
_ZL17rescue_update_navRK8CCommand
Decompiled
undefined (1 param)
/* rescue_update_nav(CCommand const&) */
void rescue_update_nav(CCommand *param_1)
{
int iVar1;
TerrorNavArea *pTVar2;
char cVar3;
long lVar4;
CBaseEntity *this;
CNavArea *pCVar5;
int iVar6;
CBaseEntity *local_50;
int local_44 [5];
undefined4 local_30;
undefined4 local_2c;
undefined4 local_28;
undefined4 local_24;
undefined4 local_20;
iVar6 = 0;
if (0 < DAT_00fe6000) {
do {
iVar1 = iVar6 * 4;
iVar6 = iVar6 + 1;
TerrorNavArea::RemoveSpawnAttributes(*(TerrorNavArea **)(TheNavAreas + iVar1),0x10000);
} while (iVar6 < DAT_00fe6000);
}
CNavMesh::ClearSelectedSet(TheNavMesh);
if (*(int *)param_1 < 2) {
local_50 = (CBaseEntity *)0x0;
while (local_50 = (CBaseEntity *)
CGlobalEntityList::FindEntityByClassname
((CGlobalEntityList *)gEntList,local_50,"info_survivor_rescue"),
local_50 != (CBaseEntity *)0x0) {
local_44[0] = 0;
local_44[1] = 0;
local_44[2] = 0;
local_44[3] = 0;
local_44[4] = 0;
local_30 = 0;
local_2c = 0;
local_28 = 0;
local_24 = 0;
local_20 = 0;
/* try { // try from 0096c225 to 0096c28e has its CatchHandler @ 0096c2f9 */
pCVar5 = (CNavArea *)CSurvivorRescue::GetRescueNavArea((CSurvivorRescue *)local_50);
if ((pCVar5 != (CNavArea *)0x0) &&
(SearchSurroundingAreas<RescueAreaCollector>
(pCVar5,(Vector *)(pCVar5 + 0x2c),(RescueAreaCollector *)local_44,350.0,0,-1),
0 < local_44[3])) {
iVar6 = 0;
do {
pTVar2 = *(TerrorNavArea **)(local_44[0] + iVar6 * 4);
TerrorNavArea::SetSpawnAttributes(pTVar2,0x10000);
CNavMesh::AddToSelectedSet(TheNavMesh,(CNavArea *)pTVar2);
iVar6 = iVar6 + 1;
} while (iVar6 < local_44[3]);
}
local_24 = 0;
CUtlMemory<CBasePropDoor*,int>::Purge((CUtlMemory<CBasePropDoor*,int> *)&local_30);
local_20 = local_30;
CUtlMemory<CBasePropDoor*,int>::Purge((CUtlMemory<CBasePropDoor*,int> *)&local_30);
local_44[3] = 0;
CUtlMemory<TerrorNavArea*,int>::Purge((CUtlMemory<TerrorNavArea*,int> *)local_44);
local_44[4] = local_44[0];
CUtlMemory<TerrorNavArea*,int>::Purge((CUtlMemory<TerrorNavArea*,int> *)local_44);
}
}
else {
lVar4 = strtol(*(char **)(param_1 + 0x40c),(char **)0x0,10);
if (((lVar4 != 0) &&
(this = (CBaseEntity *)UTIL_EntityByIndex(lVar4), this != (CBaseEntity *)0x0)) &&
((*(char **)(this + 0x7c) == "info_survivor_rescue" ||
(cVar3 = CBaseEntity::ClassMatchesComplex(this,"info_survivor_rescue"), cVar3 != '\0')))) {
local_44[0] = 0;
local_44[1] = 0;
local_44[2] = 0;
local_44[3] = 0;
local_44[4] = 0;
local_30 = 0;
local_2c = 0;
local_28 = 0;
local_24 = 0;
local_20 = 0;
/* try { // try from 0096c0fa to 0096c159 has its CatchHandler @ 0096c2dc */
pCVar5 = (CNavArea *)CSurvivorRescue::GetRescueNavArea((CSurvivorRescue *)this);
SearchSurroundingAreas<RescueAreaCollector>
(pCVar5,(Vector *)(pCVar5 + 0x2c),(RescueAreaCollector *)local_44,350.0,0,-1);
iVar6 = 0;
if (0 < local_44[3]) {
do {
pTVar2 = *(TerrorNavArea **)(local_44[0] + iVar6 * 4);
TerrorNavArea::SetSpawnAttributes(pTVar2,0x10000);
CNavMesh::AddToSelectedSet(TheNavMesh,(CNavArea *)pTVar2);
iVar6 = iVar6 + 1;
} while (iVar6 < local_44[3]);
}
local_24 = 0;
CUtlMemory<CBasePropDoor*,int>::Purge((CUtlMemory<CBasePropDoor*,int> *)&local_30);
local_20 = local_30;
CUtlMemory<CBasePropDoor*,int>::Purge((CUtlMemory<CBasePropDoor*,int> *)&local_30);
local_44[3] = 0;
CUtlMemory<TerrorNavArea*,int>::Purge((CUtlMemory<TerrorNavArea*,int> *)local_44);
local_44[4] = local_44[0];
CUtlMemory<TerrorNavArea*,int>::Purge((CUtlMemory<TerrorNavArea*,int> *)local_44);
return;
}
}
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.