CNavNode::Draw
0x00746a30 · 1331 bytes · __thiscall
_ZN8CNavNode4DrawEv
Decompiled
undefined (1 param)
/* CNavNode::Draw() */
void __thiscall CNavNode::Draw(CNavNode *this)
{
float fVar1;
uint uVar2;
int iVar3;
uint uVar4;
CNavNode *pCVar5;
int in_GS_OFFSET;
float fVar6;
float fVar7;
int iVar8;
int iVar9;
float local_48;
float local_44;
float local_40;
float local_3c;
float local_38;
float local_34;
char local_30 [16];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (*(int *)(nav_show_nodes._28_4_ + 0x30) == 0) goto LAB_00746ddb;
if (this[0x70] == (CNavNode)0x0) {
iVar3 = 0xff;
uVar4 = 0;
uVar2 = *(uint *)(this + 0x5c) & 1;
}
else {
iVar3 = 0;
uVar2 = *(uint *)(this + 0x5c) & 1;
uVar4 = -(uint)(uVar2 == 0) & 0xff;
}
NDebugOverlay::Cross3D((Vector *)this,2.0,uVar4,iVar3,-uVar2 & 0xff,true,0.1);
if (this[0x70] == (CNavNode)0x0) {
if (*(int *)(nav_show_node_id._28_4_ + 0x30) != 0) goto LAB_00746e23;
}
else if (*(int *)(nav_show_node_id._28_4_ + 0x30) < 0) {
LAB_00746e23:
V_snprintf(local_30,0x10,"%d",*(undefined4 *)(this + 0x58));
NDebugOverlay::Text((Vector *)this,local_30,true,0.1);
}
iVar3 = *(int *)(this + 0x58);
if (*(int *)(nav_test_node._28_4_ + 0x30) == iVar3) {
CNavMesh::TestArea(TheNavMesh,this,1,1);
ConVar::SetValue(0xfe8b60);
iVar3 = *(int *)(this + 0x58);
}
if (*(int *)(nav_test_node_crouch._28_4_ + 0x30) == iVar3) {
CheckCrouch(this);
ConVar::SetValue(0xfe8b00);
}
if (((byte)this[0x5c] & 1) != 0) {
iVar3 = 0;
pCVar5 = this;
do {
if ((pCVar5[0x78] != (CNavNode)0x0) || (pCVar5[0x7c] != (CNavNode)0x0)) {
if (iVar3 == 2) {
fVar7 = 1.0;
fVar6 = 1.0;
}
else if (iVar3 == 3) {
fVar6 = 1.0;
fVar7 = -1.0;
}
else {
fVar6 = -1.0;
fVar7 = 1.0;
if (iVar3 != 1) {
fVar7 = -1.0;
}
}
local_3c = fVar7 * 3.0 * 0.70710677 + *(float *)this;
local_38 = fVar6 * 3.0 * 0.70710677 + *(float *)(this + 4);
local_34 = *(float *)(this + 8);
if (pCVar5[0x78] == (CNavNode)0x0) {
iVar9 = 0xff;
iVar8 = 0;
}
else {
iVar9 = 0;
iVar8 = 0xff;
}
NDebugOverlay::HorzArrow((Vector *)this,(Vector *)&local_3c,0.5,iVar8,0,iVar9,0xff,true,0.1)
;
}
iVar3 = iVar3 + 1;
pCVar5 = pCVar5 + 1;
} while (iVar3 != 4);
}
iVar3 = 0;
pCVar5 = this;
if (*(int *)(nav_show_node_grid._28_4_ + 0x30) != 0) {
do {
if (*(Vector **)(pCVar5 + 0x18) != (Vector *)0x0) {
NDebugOverlay::Line((Vector *)this,*(Vector **)(pCVar5 + 0x18),0xff,0xff,0,false,0.1);
if (0.0 < *(float *)(pCVar5 + 0x28)) {
local_48 = *(float *)this;
local_44 = *(float *)(this + 4);
local_40 = *(float *)(this + 8);
fVar6 = *(float *)(pCVar5 + 0x28) + *(float *)(this + 8);
local_38 = *(float *)(pCVar5 + 0x38);
local_3c = local_48;
if (iVar3 == 2) {
local_38 = local_38 + local_44;
}
else if (iVar3 == 3) {
local_3c = local_48 - local_38;
local_38 = local_44;
}
else if (iVar3 == 1) {
local_3c = local_38 + local_48;
local_38 = local_44;
}
else {
local_38 = local_44 - local_38;
}
local_34 = local_40;
NDebugOverlay::Line((Vector *)&local_48,(Vector *)&local_3c,0xff,0,0xff,false,0.1);
local_48 = local_3c;
local_44 = local_38;
local_40 = local_34;
local_34 = fVar6;
NDebugOverlay::Line((Vector *)&local_48,(Vector *)&local_3c,0xff,0,0xff,false,0.1);
fVar7 = *(float *)this;
local_48 = local_3c;
local_44 = local_38;
fVar1 = *(float *)(pCVar5 + 0x48);
local_40 = local_34;
local_38 = *(float *)(this + 4);
local_3c = fVar7;
if (iVar3 == 2) {
local_38 = fVar1 + local_38;
}
else if (iVar3 == 3) {
local_3c = fVar7 - fVar1;
}
else if (iVar3 == 1) {
local_3c = fVar1 + fVar7;
}
else {
local_38 = local_38 - fVar1;
}
local_34 = fVar6;
NDebugOverlay::Line((Vector *)&local_48,(Vector *)&local_3c,0xff,0,0xff,false,0.1);
}
}
iVar3 = iVar3 + 1;
pCVar5 = pCVar5 + 4;
} while (iVar3 != 4);
}
LAB_00746ddb:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.