L L4D2node

NDebugOverlay::Triangle

0x00443140 · 884 bytes · __cdecl

_ZN13NDebugOverlay8TriangleERK6VectorS2_S2_iiiibf

Decompiled

undefined (9 params)

/* NDebugOverlay::Triangle(Vector const&, Vector const&, Vector const&, int, int, int, int, bool,
   float) */

void NDebugOverlay::Triangle
               (Vector *param_1,Vector *param_2,Vector *param_3,int param_4,int param_5,int param_6,
               int param_7,bool param_8,float param_9)

{
  char cVar1;
  CBasePlayer *this;
  float fVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  float fVar7;
  float local_38;
  float local_34;
  float local_30;
  float local_28;
  float local_24;
  float local_20;
  
  this = (CBasePlayer *)UTIL_GetListenServerHost();
  if (this == (CBasePlayer *)0x0) {
    return;
  }
  cVar1 = (**(code **)(*g_pGameRules + 0x21c))(g_pGameRules);
  if (cVar1 != '\0') goto LAB_00443368;
  if (((byte)this[0x14d] & 8) == 0) {
    fVar7 = *(float *)(this + 0x2e0);
    fVar5 = *(float *)(this + 0x2e4);
    fVar6 = *(float *)(this + 0x2e8);
    fVar2 = *(float *)param_1 - fVar7;
    fVar3 = *(float *)(param_1 + 4) - fVar5;
    fVar4 = *(float *)(param_1 + 8) - fVar6;
LAB_004431b8:
    local_30 = *(float *)param_2 - fVar7;
    local_38 = *(float *)(param_2 + 8) - fVar6;
    local_34 = *(float *)(param_2 + 4) - fVar5;
  }
  else {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    fVar7 = *(float *)(this + 0x2e0);
    fVar5 = *(float *)(this + 0x2e4);
    fVar6 = *(float *)(this + 0x2e8);
    fVar2 = *(float *)param_1 - fVar7;
    fVar3 = *(float *)(param_1 + 4) - fVar5;
    fVar4 = *(float *)(param_1 + 8) - fVar6;
    if (((byte)this[0x14d] & 8) == 0) goto LAB_004431b8;
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    fVar7 = *(float *)(this + 0x2e0);
    fVar6 = *(float *)(this + 0x2e8);
    local_30 = *(float *)param_2 - fVar7;
    fVar5 = *(float *)(this + 0x2e4);
    local_34 = *(float *)(param_2 + 4) - fVar5;
    local_38 = *(float *)(param_2 + 8) - fVar6;
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
      fVar7 = *(float *)(this + 0x2e0);
      fVar5 = *(float *)(this + 0x2e4);
      fVar6 = *(float *)(this + 0x2e8);
    }
  }
  fVar7 = *(float *)param_3 - fVar7;
  fVar5 = *(float *)(param_3 + 4) - fVar5;
  fVar6 = *(float *)(param_3 + 8) - fVar6;
  if (((9e+07 < fVar2 * fVar2 + fVar4 * fVar4 + fVar3 * fVar3) &&
      (9e+07 < local_34 * local_34 + local_38 * local_38 + local_30 * local_30)) &&
     (9e+07 < fVar5 * fVar5 + fVar7 * fVar7 + fVar6 * fVar6)) {
    return;
  }
  CBasePlayer::EyeVectors(this,(Vector *)&local_28,(Vector *)0x0,(Vector *)0x0);
  if (((fVar3 * local_24 + fVar2 * local_28 + fVar4 * local_20 < 0.0) &&
      (local_34 * local_24 + local_30 * local_28 + local_38 * local_20 < 0.0)) &&
     (fVar5 * local_24 + local_28 * fVar7 + fVar6 * local_20 < 0.0)) {
    return;
  }
LAB_00443368:
  if (debugoverlay == (int *)0x0) {
    return;
  }
  (**(code **)(*debugoverlay + 8))
            (debugoverlay,param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9);
  return;
}

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)