SelectClimbUpFromStairs
0x0098d640 · 628 bytes · __regparm3
_ZL23SelectClimbUpFromStairsP16NavAreaCollector
Decompiled
undefined (1 param)
/* SelectClimbUpFromStairs(NavAreaCollector*) */
void __regparm3 SelectClimbUpFromStairs(NavAreaCollector *param_1)
{
CNavArea *pCVar1;
CNavArea *this;
int iVar2;
int *piVar3;
int iVar4;
int iVar5;
char cVar6;
int local_78;
int local_70;
float local_6c;
CNavArea *local_68;
NavAreaCollector *local_64;
int local_60;
char *local_5c;
float local_58;
float local_54;
float local_50;
float local_4c;
float local_48;
float local_44;
float local_40;
float local_3c;
float local_38;
Vector local_34 [8];
float local_2c;
Vector local_28 [8];
float local_20;
local_60 = *(int *)(param_1 + 0x10);
local_5c = "Climb links from stairs check";
local_64 = param_1;
if (0 < DAT_00fe6000) {
local_78 = 0;
do {
pCVar1 = *(CNavArea **)(TheNavAreas + local_78 * 4);
if (((byte)pCVar1[0x55] & 0x10) != 0) {
if (s_testNavID < 1) {
cVar6 = IsAreaTestable(pCVar1);
}
else {
cVar6 = s_testNavID == *(int *)(pCVar1 + 0x8c);
}
if (cVar6 != '\0') {
local_70 = 0;
do {
piVar3 = *(int **)(pCVar1 + local_70 * 4 + 0x58);
if (0 < *piVar3) {
iVar5 = 0;
do {
this = (CNavArea *)piVar3[iVar5 * 2 + 1];
if (this != (CNavArea *)0x0) {
/* try { // try from 0098d6f0 to 0098d800 has its CatchHandler @ 0098d8ce */
CNavArea::ComputePortal(pCVar1,this,local_70,&local_40,&local_6c);
if (1.0 <= local_6c) {
local_58 = local_40;
local_54 = local_3c;
local_50 = local_38;
local_4c = local_40;
local_48 = local_3c;
local_44 = local_38;
if ((local_70 == 1) || (local_70 == 3)) {
local_54 = local_3c - local_6c;
local_48 = local_6c + local_3c;
}
else {
local_4c = local_40 - local_6c;
local_58 = local_40 + local_6c;
}
CNavArea::GetClosestPointOnArea(this,(Vector *)&local_58,local_34);
CNavArea::GetClosestPointOnArea(this,(Vector *)&local_4c,local_28);
if ((local_50 + 18.0 < local_2c) || (local_44 + 18.0 < local_20)) {
local_68 = pCVar1;
if (*param_1 == (NavAreaCollector)0x0) {
iVar4 = *(int *)(param_1 + 0x10);
}
else {
iVar4 = *(int *)(param_1 + 0x10);
if (0 < iVar4) {
iVar2 = 0;
if (pCVar1 != (CNavArea *)**(int **)(param_1 + 4)) {
do {
iVar2 = iVar2 + 1;
if (iVar2 == iVar4) goto LAB_0098d7e8;
} while (pCVar1 != (CNavArea *)(*(int **)(param_1 + 4))[iVar2]);
if (iVar2 < 0) goto LAB_0098d7e8;
}
goto LAB_0098d801;
}
}
LAB_0098d7e8:
CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>>::InsertBefore
((CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>> *)(param_1 + 4),
iVar4,&local_68);
}
}
LAB_0098d801:
piVar3 = *(int **)(pCVar1 + local_70 * 4 + 0x58);
}
iVar5 = iVar5 + 1;
} while (iVar5 < *piVar3);
}
local_70 = local_70 + 1;
} while (local_70 != 4);
}
}
local_78 = local_78 + 1;
} while (local_78 < DAT_00fe6000);
if (local_60 < *(int *)(local_64 + 0x10)) {
Warning("%s found %d areas\n",local_5c,*(int *)(local_64 + 0x10) - local_60);
return;
}
}
Msg("%s passed\n",local_5c);
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.