CNavNode::CheckCrouch
0x00746860 · 442 bytes · __thiscall
_ZN8CNavNode11CheckCrouchEv
Decompiled
undefined (1 param)
/* CNavNode::CheckCrouch() */
void __thiscall CNavNode::CheckCrouch(CNavNode *this)
{
char cVar1;
int iVar2;
CNavNode *pCVar3;
float fVar4;
float fVar5;
float fVar6;
float fVar7;
float local_34;
float local_30;
undefined4 local_2c;
float local_28;
float local_24;
undefined4 local_20;
iVar2 = 0;
pCVar3 = this + 0x80;
do {
if ((*(int *)(nav_test_node_crouch_dir._28_4_ + 0x30) == 4) ||
(iVar2 == *(int *)(nav_test_node_crouch_dir._28_4_ + 0x30))) {
if (iVar2 == 2) {
fVar5 = 1.0;
fVar6 = 1.0;
}
else if (iVar2 == 3) {
fVar6 = 1.0;
fVar5 = -1.0;
}
else {
fVar6 = -1.0;
fVar5 = 1.0;
if (iVar2 != 1) {
fVar5 = -1.0;
}
}
fVar4 = 0.0;
local_34 = 0.0;
local_30 = 0.0;
local_2c = 0;
local_28 = 0.0;
local_24 = 0.0;
if (fVar5 * 0.70710677 < 0.0) {
fVar4 = 0.0;
local_34 = -16.0;
fVar7 = -16.0;
}
else {
fVar7 = fVar4;
if (0.0 < fVar5 * 0.70710677) {
fVar4 = 16.0;
local_28 = 16.0;
fVar7 = 0.0;
}
}
if (fVar6 * 0.70710677 < 0.0) {
local_30 = -16.0;
}
else if (0.0 < fVar6 * 0.70710677) {
local_24 = 16.0;
}
local_20 = 0x428e0000;
if (fVar4 < fVar7) {
local_34 = fVar4;
local_28 = fVar7;
}
fVar5 = local_30;
if (local_24 < local_30) {
fVar5 = local_24;
local_24 = local_30;
}
local_30 = fVar5;
cVar1 = TestForCrouchArea(this,iVar2,&local_34,&local_28,pCVar3);
if (cVar1 == '\0') {
*(undefined4 *)(this + 0x5c) = 1;
this[iVar2 + 0x7c] = (CNavNode)0x1;
}
}
iVar2 = iVar2 + 1;
pCVar3 = pCVar3 + 4;
} while (iVar2 != 4);
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.