L L4D2node

NDebugOverlay::Line

0x00442e70 · 694 bytes · __cdecl

_ZN13NDebugOverlay4LineERK6VectorS2_iiibf

Decompiled

undefined (7 params)

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

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

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