L L4D2node

CBaseEntity::DrawDebugGeometryOverlays

0x0060a160 · 2134 bytes · __thiscall

_ZN11CBaseEntity25DrawDebugGeometryOverlaysEv

Decompiled

undefined (1 param)

/* CBaseEntity::DrawDebugGeometryOverlays() */

void __thiscall CBaseEntity::DrawDebugGeometryOverlays(CBaseEntity *this)

{
  char cVar1;
  int iVar2;
  CBaseCombatCharacter *this_00;
  undefined4 *puVar3;
  char *pcVar4;
  int *piVar5;
  uint uVar6;
  int iVar7;
  longdouble lVar8;
  float fVar9;
  CBaseEntity *pCVar10;
  IPhysicsObject *in_stack_ffffef68;
  IPhysicsObject *pIVar11;
  float local_1064;
  float local_1060;
  float local_105c;
  float local_1058;
  float local_1054;
  float local_1050;
  float local_104c;
  float local_1048;
  float local_1044;
  float local_1040;
  float local_103c;
  float local_1038;
  undefined4 local_1034;
  undefined4 local_1030;
  undefined4 local_102c;
  float local_1028;
  float local_1024;
  float local_1020;
  float local_101c [1027];
  
  DrawTimedOverlays(this);
  pCVar10 = this;
  (**(code **)(*(int *)this + 0xc0))();
  uVar6 = *(uint *)(this + 0x110);
  if ((uVar6 & 2) != 0) {
    pcVar4 = (char *)GetDebugName(this);
    in_stack_ffffef68 = (IPhysicsObject *)0x0;
    pCVar10 = this;
    EntityText(this,0,pcVar4,0.0,0xff,0xff,0xff,0xff);
    uVar6 = *(uint *)(this + 0x110);
  }
  if ((uVar6 & 4) != 0) {
    in_stack_ffffef68 = (IPhysicsObject *)0x0;
    pCVar10 = this;
    DrawBBoxOverlay(this,0.0);
    uVar6 = *(uint *)(this + 0x110);
  }
  if ((uVar6 & 0x20) != 0) {
    pCVar10 = this;
    DrawAbsBoxOverlay(this);
    uVar6 = *(uint *)(this + 0x110);
  }
  if ((uVar6 & 8) != 0) {
    pCVar10 = this;
    SendDebugPivotOverlay(this);
    uVar6 = *(uint *)(this + 0x110);
  }
  if ((uVar6 & 0xc) != 0) {
    if (*(int *)(this + 0x238) != 0) {
      DrawVPhysicsObjectCenterAndContactPoints(pCVar10,in_stack_ffffef68);
    }
    pCVar10 = this;
    pIVar11 = (IPhysicsObject *)local_101c;
    iVar2 = (**(code **)(*(int *)this + 0x2b8))(this,(IPhysicsObject *)local_101c,0x400);
    if (0 < iVar2) {
      iVar7 = 0;
      do {
        if (*(int *)((IPhysicsObject *)local_101c + iVar7 * 4) != 0) {
          DrawVPhysicsObjectCenterAndContactPoints(pCVar10,pIVar11);
        }
        iVar7 = iVar7 + 1;
      } while (iVar7 != iVar2);
    }
    uVar6 = *(uint *)(this + 0x110);
  }
  if ((uVar6 & 0x80) != 0) {
    cVar1 = BlocksLOS(this);
    if (cVar1 != '\0') {
      NDebugOverlay::EntityBounds(this,0xff,0xff,0xff,0,0.0);
    }
    uVar6 = *(uint *)(this + 0x110);
  }
  if (((uVar6 & 0x200) != 0) && (((byte)this[0x152] & 1) != 0)) {
    (**(code **)(*(int *)this + 0x110))((Vector *)&local_1064,this);
    this_00 = (CBaseCombatCharacter *)
              UTIL_PlayerByIndex(*(int *)(autoaim_viewing_client._28_4_ + 0x30));
    lVar8 = (longdouble)(**(code **)(*(int *)this + 0x10c))(this);
    fVar9 = (float)lVar8;
    puVar3 = (undefined4 *)(**(code **)(*(int *)this_00 + 0x238))(this_00);
    local_1034 = *puVar3;
    local_1030 = puVar3[1];
    local_102c = puVar3[2];
    AngleVectors((QAngle *)&local_1034,(Vector *)0x0,(Vector *)&local_1058,(Vector *)&local_104c);
    if ((int)*(float *)(gpGlobals + 0xc) % 2 == 1) {
      iVar2 = CBaseCombatCharacter::GetActiveWeapon(this_00);
      if (iVar2 == 0) {
        iVar2 = 0xff;
        uVar6 = 0xff;
      }
      else {
        iVar2 = 0xff;
        uVar6 = 0xff;
        piVar5 = (int *)CBaseCombatCharacter::GetActiveWeapon(this_00);
        lVar8 = (longdouble)(**(code **)(*piVar5 + 0x4c8))(piVar5);
        fVar9 = fVar9 * (float)lVar8;
      }
    }
    else {
      iVar2 = 0;
      cVar1 = (**(code **)(*(int *)this + 0x108))(this,this_00);
      uVar6 = -(uint)(cVar1 == '\0') & 0xff;
    }
    cVar1 = (**(code **)(*(int *)this_00 + 0x4fc))(this_00);
    if (cVar1 != '\0') {
      fVar9 = fVar9 * *(float *)(sv_vehicle_autoaim_scale._28_4_ + 0x2c);
    }
    local_101c[1] = local_1054 * fVar9 + local_1060;
    local_101c[2] = local_1050 * fVar9 + local_105c;
    local_101c[0] = fVar9 * local_1058 + local_1064;
    NDebugOverlay::Line((Vector *)&local_1064,(Vector *)local_101c,0xff,uVar6,iVar2,true,0.1);
    local_101c[0] = local_1064 - local_1058 * fVar9;
    local_101c[1] = local_1060 - local_1054 * fVar9;
    local_101c[2] = local_105c - local_1050 * fVar9;
    NDebugOverlay::Line((Vector *)&local_1064,(Vector *)local_101c,0xff,uVar6,iVar2,true,0.1);
    local_101c[1] = local_1048 * fVar9 + local_1060;
    local_101c[2] = local_1044 * fVar9 + local_105c;
    local_101c[0] = local_104c * fVar9 + local_1064;
    NDebugOverlay::Line((Vector *)&local_1064,(Vector *)local_101c,0xff,uVar6,iVar2,true,0.1);
    local_101c[0] = local_1064 - local_104c * fVar9;
    local_101c[1] = local_1060 - local_1048 * fVar9;
    local_101c[2] = local_105c - local_1044 * fVar9;
    NDebugOverlay::Line((Vector *)&local_1064,(Vector *)local_101c,0xff,uVar6,iVar2,true,0.1);
    local_103c = local_1048 + local_1054;
    local_1038 = local_1044 + local_1050;
    local_1040 = local_104c + local_1058;
    VectorNormalize((Vector *)&local_1040);
    local_101c[0] = local_1040 * fVar9 + local_1064;
    local_1028 = local_1064 - local_1040 * fVar9;
    local_101c[1] = local_103c * fVar9 + local_1060;
    local_1024 = local_1060 - local_103c * fVar9;
    local_101c[2] = local_1038 * fVar9 + local_105c;
    local_1020 = local_105c - local_1038 * fVar9;
    NDebugOverlay::Line((Vector *)&local_1028,(Vector *)local_101c,0xff,uVar6,iVar2,true,0.1);
    local_103c = local_1054 - local_1048;
    local_1038 = local_1050 - local_1044;
    local_1040 = local_1058 - local_104c;
    VectorNormalize((Vector *)&local_1040);
    local_101c[0] = local_1040 * fVar9 + local_1064;
    local_1028 = local_1064 - local_1040 * fVar9;
    local_101c[1] = local_103c * fVar9 + local_1060;
    local_1024 = local_1060 - local_103c * fVar9;
    local_101c[2] = fVar9 * local_1038 + local_105c;
    local_1020 = local_105c - fVar9 * local_1038;
    NDebugOverlay::Line((Vector *)&local_1028,(Vector *)local_101c,0xff,uVar6,iVar2,true,0.1);
  }
  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)