CNavArea::UpdateBlockedFromTrace
0x00702a90 · 2134 bytes · __thiscall
_ZN8CNavArea22UpdateBlockedFromTraceEbib
Decompiled
undefined (4 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CNavArea::UpdateBlockedFromTrace(bool, int, bool) */
void __thiscall
CNavArea::UpdateBlockedFromTrace(CNavArea *this,bool param_1,int param_2,bool param_3)
{
uint uVar1;
char cVar2;
int iVar3;
CNavArea *pCVar4;
char *pcVar5;
byte bVar6;
int iVar7;
float fVar8;
float fVar9;
undefined4 local_134;
undefined4 local_130;
float local_128;
float local_124;
float local_120;
undefined4 local_11c;
undefined4 local_118;
undefined4 local_114;
undefined4 local_110;
undefined4 local_10c;
undefined4 local_108;
undefined4 local_104;
undefined4 local_100;
int local_fc;
undefined **local_f8 [4];
undefined4 local_e8;
float local_e4;
float local_e0;
float local_dc;
float local_d8;
float local_d4;
float local_d0;
float local_cc;
float local_c8;
float local_c4;
undefined4 local_bc;
undefined4 local_b8;
undefined4 local_b4;
float local_ac;
float local_a8;
float local_a4;
float local_9c;
float local_98;
float local_94;
undefined4 local_8c;
undefined1 local_88;
undefined1 local_87;
undefined4 local_70;
undefined4 local_6c;
undefined4 local_68;
Vector local_64 [43];
char local_39;
int local_24;
iVar7 = 0;
local_128 = *(float *)(this + 0x2c);
local_124 = *(float *)(this + 0x30);
local_120 = *(float *)(this + 0x34) + 35.5;
iVar3 = GetWorldEntity();
local_11c = *(undefined4 *)(iVar3 + 0x448);
local_118 = *(undefined4 *)(iVar3 + 0x44c);
local_114 = *(undefined4 *)(iVar3 + 0x450);
local_110 = *(undefined4 *)(iVar3 + 0x454);
local_10c = *(undefined4 *)(iVar3 + 0x458);
local_108 = *(undefined4 *)(iVar3 + 0x45c);
do {
if (iVar7 == 2) {
local_70 = *(undefined4 *)(this + 0x10);
local_6c = *(undefined4 *)(this + 0x14);
local_68 = *(undefined4 *)(this + 0x18);
}
else if (iVar7 == 3) {
local_6c = *(undefined4 *)(this + 0x14);
local_68 = *(undefined4 *)(this + 0x28);
local_70 = *(undefined4 *)(this + 4);
}
else if (iVar7 == 1) {
local_6c = *(undefined4 *)(this + 8);
local_68 = *(undefined4 *)(this + 0x24);
local_70 = *(undefined4 *)(this + 0x10);
}
else {
local_70 = *(undefined4 *)(this + 4);
local_6c = *(undefined4 *)(this + 8);
local_68 = *(undefined4 *)(this + 0xc);
}
cVar2 = IsPointInBox((Vector *)&local_70,(Vector *)&local_11c,(Vector *)&local_110);
if (cVar2 == '\0') {
return;
}
iVar7 = iVar7 + 1;
} while (iVar7 != 4);
fVar8 = (*(float *)(this + 0x10) - *(float *)(this + 4)) * 0.5;
if (21.0 <= fVar8) {
local_e4 = -16.0;
fVar8 = 16.0;
}
else if (6.0 <= fVar8) {
fVar8 = fVar8 - 5.0;
local_e4 = -fVar8;
}
else {
local_e4 = -1.0;
fVar8 = 1.0;
}
fVar9 = (*(float *)(this + 0x14) - *(float *)(this + 8)) * 0.5;
if (21.0 <= fVar9) {
local_e0 = -16.0;
fVar9 = 16.0;
}
else if (6.0 <= fVar9) {
fVar9 = fVar9 - 5.0;
local_e0 = -fVar9;
}
else {
local_e0 = -1.0;
fVar9 = 1.0;
}
local_dc = 0.0;
iVar3 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
local_d0 = *(float *)(iVar3 + 0x38) - 35.5;
local_d8 = fVar8;
local_d4 = fVar9;
CTraceFilterSimple::CTraceFilterSimple
((CTraceFilterSimple *)local_f8,(IHandleEntity *)0x0,8,
(_func_bool_IHandleEntity_ptr_int *)0x0);
local_f8[0] = &PTR_ShouldHitEntity_00ca1b68;
local_e8 = 5;
local_134 = 0;
local_130 = 0;
if (___atan2f_finite == 0) {
local_fc = 0;
}
else {
(**(code **)(___atan2f_finite + 0x50))
(___atan2f_finite,&local_134,0,0,0,0,"/data/src/game/server/nav_area.cpp",0x131d,
&UpdateBlockedFromTrace(bool,int,bool)::tm_fmt,"(%s)%s","Unaccounted",
"CNavArea::UpdateBlocked-Trace");
local_fc = ___atan2f_finite;
}
iVar3 = _DAT_0105db00;
local_104 = local_134;
local_100 = local_130;
/* try { // try from 00702d87 to 00702d8b has its CatchHandler @ 00703351 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar7 = ThreadGetCurrentId(), iVar3 == iVar7)) {
if ((char *)*_DAT_0105d15c != "CNavArea::UpdateBlocked-Trace") {
/* try { // try from 00703270 to 00703281 has its CatchHandler @ 00703351 */
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xca137e,(char *)0x1,0xbfafa1);
}
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
local_87 = 0;
local_bc = 0;
local_b8 = 0;
local_b4 = 0;
local_8c = 0;
local_9c = (local_d8 - local_e4) * 0.5;
local_94 = (local_d0 - local_dc) * 0.5;
local_98 = (local_d4 - local_e0) * 0.5;
local_ac = (local_d8 + local_e4) * 0.5;
local_a8 = (local_d4 + local_e0) * 0.5;
local_a4 = (local_d0 + local_dc) * 0.5;
local_cc = local_128 + local_ac;
local_c8 = local_124 + local_a8;
local_c4 = local_120 + local_a4;
local_88 = local_9c * local_9c + local_94 * local_94 + local_98 * local_98 < 1e-06;
local_ac = -local_ac;
local_a8 = -local_a8;
local_a4 = -local_a4;
/* try { // try from 00702f14 to 00702f59 has its CatchHandler @ 0070332d */
(**(code **)(*enginetrace + 0x14))
(enginetrace,&local_cc,0x2420b,(CTraceFilterSimple *)local_f8,(Vector *)&local_70);
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
DebugDrawLine((Vector *)&local_70,local_64,0xff,0xff,0,true,-1.0);
}
iVar3 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar7 = ThreadGetCurrentId(), iVar3 == iVar7)) {
cVar2 = CVProfNode::ExitScope();
if (cVar2 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_fc != 0) {
(**(code **)(local_fc + 0x54))(local_fc,local_104,local_100,0,0,0);
}
if (local_39 == '\0') {
if (!param_3) {
if (*(int *)(DebugZombieBreakables._28_4_ + 0x30) == 0) {
this[0x7f] = (CNavArea)0x0;
}
else {
NDebugOverlay::Box((Vector *)&local_128,(Vector *)&local_e4,(Vector *)&local_d8,0,0xff,0,10,
5.0);
}
}
goto LAB_00702fe8;
}
if (!param_1) goto LAB_00702fe8;
pcVar5 = *(char **)(local_24 + 0x7c);
if (pcVar5 == (char *)0x0) {
pcVar5 = "";
LAB_007030ba:
iVar3 = _V_stricmp(pcVar5,"func_door");
if (iVar3 == 0) goto LAB_007030d5;
if (param_2 != -1) {
cVar2 = (char)(param_2 >> 0x1f);
bVar6 = (byte)(1 << (((char)param_2 - cVar2 & 1U) + cVar2 & 0x1f));
goto LAB_007032df;
}
}
else {
if (pcVar5 != "func_door") goto LAB_007030ba;
LAB_007030d5:
uVar1 = *(uint *)(local_24 + 0x148);
if ((uVar1 & 0x60000) != 0) {
if ((uVar1 & 0x20000) == 0) {
bVar6 = 1;
param_2 = 2;
}
else {
if ((uVar1 & 0x40000) != 0) goto LAB_007032f0;
bVar6 = 2;
param_2 = 3;
}
LAB_007032df:
this[0x7f] = (CNavArea)((byte)this[0x7f] | bVar6);
goto LAB_00702fe8;
}
}
LAB_007032f0:
this[0x7f] = (CNavArea)0x3;
param_2 = -1;
LAB_00702fe8:
pCVar4 = (CNavArea *)CNavMesh::GetMarkedArea(TheNavMesh);
if (this != pCVar4) {
return;
}
cVar2 = IsBlocked(this,param_2,false);
if (cVar2 == '\0') {
iVar7 = 0xff;
iVar3 = 0;
}
else {
iVar7 = 0;
iVar3 = 0xff;
}
NDebugOverlay::Box((Vector *)&local_128,(Vector *)&local_e4,(Vector *)&local_d8,iVar3,iVar7,0,0x40
,3.0);
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.