L L4D2node

TerrorNavArea::IsPartiallyVisible

0x00974630 · 1266 bytes · __thiscall

_ZNK13TerrorNavArea18IsPartiallyVisibleERK6Vector

Decompiled

undefined (2 params)

/* TerrorNavArea::IsPartiallyVisible(Vector const&) const */

undefined4 __thiscall TerrorNavArea::IsPartiallyVisible(TerrorNavArea *this,Vector *param_1)

{
  float fVar1;
  int iVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  float local_f4;
  float local_f0;
  float local_ec;
  float local_e8;
  float local_e4;
  float local_e0;
  undefined **local_dc [4];
  float local_cc;
  float local_c8;
  float local_c4;
  float local_bc;
  float local_b8;
  float local_b4;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_8c;
  undefined1 local_88;
  undefined1 local_87;
  Vector local_70 [12];
  Vector local_64 [32];
  float local_44;
  
  CTraceFilterSimple::CTraceFilterSimple
            ((CTraceFilterSimple *)local_dc,(IHandleEntity *)0x0,0,
             (_func_bool_IHandleEntity_ptr_int *)0x0);
  local_cc = *(float *)param_1;
  local_88 = 1;
  local_c8 = *(float *)(param_1 + 4);
  local_dc[0] = &PTR_ShouldHitEntity_00c54558;
  local_b8 = *(float *)(this + 0x30) - local_c8;
  local_8c = 0;
  local_bc = *(float *)(this + 0x2c) - local_cc;
  local_c4 = *(float *)(param_1 + 8);
  local_b4 = (*(float *)(this + 0x34) + 53.25) - local_c4;
  local_94 = 0;
  local_98 = 0;
  local_9c = 0;
  local_87 = local_bc * local_bc + local_b8 * local_b8 + local_b4 * local_b4 != 0.0;
  local_a4 = 0;
  local_a8 = 0;
  local_ac = 0;
  (**(code **)(*enginetrace + 0x14))
            (enginetrace,&local_cc,0x2006041,(CTraceFilterSimple *)local_dc,local_70);
  if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
    DebugDrawLine(local_70,local_64,0xff,0,0,true,-1.0);
  }
  if (1.0 <= local_44) {
    return 1;
  }
  local_f0 = *(float *)(this + 0x30) - *(float *)(param_1 + 4);
  local_f4 = *(float *)(this + 0x2c) - *(float *)param_1;
  local_ec = (*(float *)(this + 0x34) + 53.25) - *(float *)(param_1 + 8);
  VectorNormalize((Vector *)&local_f4);
  fVar1 = *(float *)(NavPotentiallyVisibleDotTolerance._28_4_ + 0x2c);
  iVar2 = 0;
  do {
    if (iVar2 == 2) {
      fVar4 = *(float *)(this + 0x10);
      fVar3 = *(float *)(this + 0x14);
      fVar5 = *(float *)(this + 0x18);
    }
    else if (iVar2 == 3) {
      fVar5 = *(float *)(this + 0x28);
      fVar3 = *(float *)(this + 0x14);
      fVar4 = *(float *)(this + 4);
    }
    else if (iVar2 == 1) {
      fVar5 = *(float *)(this + 0x24);
      fVar3 = *(float *)(this + 8);
      fVar4 = *(float *)(this + 0x10);
    }
    else {
      fVar4 = *(float *)(this + 4);
      fVar3 = *(float *)(this + 8);
      fVar5 = *(float *)(this + 0xc);
    }
    local_e8 = fVar4 - *(float *)param_1;
    local_e4 = fVar3 - *(float *)(param_1 + 4);
    local_e0 = (fVar5 + 53.25) - *(float *)(param_1 + 8);
    VectorNormalize((Vector *)&local_e8);
    if (local_f0 * local_e4 + local_f4 * local_e8 + local_ec * local_e0 < fVar1) {
      local_cc = *(float *)param_1;
      local_88 = 1;
      local_c8 = *(float *)(param_1 + 4);
      local_c4 = *(float *)(param_1 + 8);
      local_bc = fVar4 - local_cc;
      local_b8 = fVar3 - local_c8;
      local_94 = 0;
      local_98 = 0;
      local_9c = 0;
      local_b4 = (53.25 - local_c4) + fVar5 + 53.25;
      local_8c = 0;
      local_a4 = 0;
      local_a8 = 0;
      local_ac = 0;
      local_87 = local_b8 * local_b8 + local_bc * local_bc + local_b4 * local_b4 != 0.0;
      (**(code **)(*enginetrace + 0x14))
                (enginetrace,&local_cc,0x2006041,(CTraceFilterSimple *)local_dc,local_70);
      if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
        DebugDrawLine(local_70,local_64,0xff,0,0,true,-1.0);
      }
      if (1.0 <= local_44) {
        return 1;
      }
    }
    iVar2 = iVar2 + 1;
    if (iVar2 == 4) {
      return 0;
    }
  } while( true );
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)