L L4D2node

CTerrorPlayer::UpdateSurvivorDebugDraws

0x009fd150 · 1441 bytes · __thiscall

_ZN13CTerrorPlayer24UpdateSurvivorDebugDrawsEv

Decompiled

undefined (1 param)

/* CTerrorPlayer::UpdateSurvivorDebugDraws() */

void __thiscall CTerrorPlayer::UpdateSurvivorDebugDraws(CTerrorPlayer *this)

{
  char cVar1;
  TerrorNavArea *this_00;
  TerrorNavArea *this_01;
  CTerrorPlayer *pCVar2;
  int *piVar3;
  uint uVar4;
  uint uVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  undefined1 local_40 [4];
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  if (*(int *)(this + 0x30) == 0) {
    if (*(int *)(nav_show_player_area._28_4_ + 0x30) != 0) goto LAB_009fd183;
  }
  else if (*(int *)(nav_show_player_area._28_4_ + 0x30) !=
           *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4) goto LAB_009fd183;
  piVar3 = (int *)(**(code **)(*(int *)this + 0x52c))(this);
  if (piVar3 != (int *)0x0) {
    (**(code **)(*piVar3 + 0x54))(piVar3,0,0,0xff,0x32,0x3dcccccd,1);
  }
  if ((this[0x39f1] != (CTerrorPlayer)0x0) &&
     (piVar3 = *(int **)(this + 0x3a64), piVar3 != (int *)0x0)) {
    (**(code **)(*piVar3 + 0x54))(piVar3,0,0xff,0,0x32,0x3dcccccd,1);
  }
LAB_009fd183:
  if (*(int *)(SurvivorDebugActiveAreaSet._28_4_ + 0x30) != 0) {
    GetDebugColorForSurvivor
              (local_40,this,*(undefined4 *)(this + 0x2ba0),&local_3c,&local_38,&local_34);
    iVar6 = *(int *)(SurvivorDebugActiveAreaSet._28_4_ + 0x30);
    if (iVar6 == 1) {
      iVar6 = 0;
      if (0 < *(int *)(this + 0x30f4)) {
        do {
          piVar3 = *(int **)(*(int *)(this + 0x30e8) + iVar6 * 4);
          iVar6 = iVar6 + 1;
          (**(code **)(*piVar3 + 0x54))(piVar3,local_3c,local_38,local_34,100,0x3dcccccd,1);
        } while (iVar6 < *(int *)(this + 0x30f4));
      }
    }
    else if (iVar6 == 2) {
      if (0 < DAT_00fe6000) {
        iVar6 = 0;
        do {
          piVar3 = *(int **)(TheNavAreas + iVar6 * 4);
          uVar4 = piVar3[0x57];
          if (*(int *)(this + 0x2ba0) != 8) {
            uVar4 = uVar4 & 1 << ((byte)*(int *)(this + 0x2ba0) & 0x1f);
          }
          if (uVar4 != 0) {
            (**(code **)(*piVar3 + 0x54))(piVar3,local_3c,local_38,local_34,100,0x3dcccccd,1);
          }
          iVar6 = iVar6 + 1;
        } while (iVar6 < DAT_00fe6000);
      }
    }
    else if (iVar6 == 3) {
      if (0 < DAT_00fe6000) {
        iVar6 = 0;
        do {
          piVar3 = *(int **)(TheNavAreas + iVar6 * 4);
          uVar4 = piVar3[0x57];
          if (*(int *)(this + 0x2ba0) != 8) {
            uVar4 = uVar4 & 1 << ((byte)*(int *)(this + 0x2ba0) & 0x1f);
          }
          if (uVar4 != 0) {
            if (*(int *)(this + 0x30f4) < 1) {
LAB_009fd6a4:
              (**(code **)(*piVar3 + 0x54))(piVar3,0xff,0,0,100,0x3dcccccd,1);
            }
            else if (piVar3 != (int *)**(int **)(this + 0x30e8)) {
              iVar7 = 0;
              do {
                iVar7 = iVar7 + 1;
                if (iVar7 == *(int *)(this + 0x30f4)) goto LAB_009fd6a4;
              } while (piVar3 != (int *)(*(int **)(this + 0x30e8))[iVar7]);
              if (iVar7 == -1) goto LAB_009fd6a4;
            }
          }
          iVar6 = iVar6 + 1;
        } while (iVar6 < DAT_00fe6000);
      }
    }
    else if (((iVar6 == 4) && (pCVar2 = (CTerrorPlayer *)UTIL_GetListenServerHost(), this == pCVar2)
             ) && (0 < DAT_00fe6000)) {
      iVar6 = 0;
      do {
        piVar3 = *(int **)(TheNavAreas + iVar6 * 4);
        iVar7 = 0;
        do {
          while ((piVar3[0x57] & 1 << ((byte)iVar7 & 0x1f)) == 0) {
            iVar7 = iVar7 + 1;
            if (iVar7 == 8) goto LAB_009fd474;
          }
          iVar8 = iVar7 + 1;
          GetDebugColorForSurvivor(local_40,this,iVar7,&local_30,&local_2c,&local_28);
          (**(code **)(*piVar3 + 0x54))(piVar3,local_30,local_2c,local_28,100,0x3dcccccd,1);
          iVar7 = iVar8;
        } while (iVar8 != 8);
LAB_009fd474:
        iVar6 = iVar6 + 1;
      } while (iVar6 < DAT_00fe6000);
    }
  }
  if ((*(int *)(SurvivorDebugVisibility._28_4_ + 0x30) != 0) && (0 < DAT_00fe6000)) {
    iVar6 = 0;
    do {
      piVar3 = *(int **)(TheNavAreas + iVar6 * 4);
      uVar4 = 0;
      do {
        while ((*(byte *)((int)piVar3 + 0x7d) >> (uVar4 & 0x1f) & 1) == 0) {
          uVar4 = uVar4 + 1;
          if (uVar4 == 8) goto LAB_009fd244;
        }
        uVar5 = uVar4 + 1;
        GetDebugColorForSurvivor(local_40,this,uVar4,&local_30,&local_2c,&local_28);
        (**(code **)(*piVar3 + 0x54))(piVar3,local_30,local_2c,local_28,100,0x3dcccccd,1);
        uVar4 = uVar5;
      } while (uVar5 != 8);
LAB_009fd244:
      iVar6 = iVar6 + 1;
    } while (iVar6 < DAT_00fe6000);
  }
  if ((*(int *)(ZombieShowEscapeRoute._28_4_ + 0x30) != 0) &&
     (this_00 = (TerrorNavArea *)(**(code **)(*(int *)this + 0x52c))(this),
     this_00 != (TerrorNavArea *)0x0)) {
    local_28 = *(undefined4 *)(this_00 + 0x2c);
    local_24 = *(undefined4 *)(this_00 + 0x30);
    local_20 = *(undefined4 *)(this_00 + 0x34);
    CNavArea::m_masterMarker = CNavArea::m_masterMarker + 1;
    if (CNavArea::m_masterMarker == 0) {
      CNavArea::m_masterMarker = 1;
    }
    *(int *)(this_00 + 0x3c) = CNavArea::m_masterMarker;
    this_01 = this_00;
    while (((this_01 = (TerrorNavArea *)
                       TerrorNavArea::GetNextEscapeStep(this_01,(NavTraverseType *)0x0),
            this_01 != (TerrorNavArea *)0x0 &&
            (*(int *)(this_01 + 0x3c) != CNavArea::m_masterMarker)) &&
           (cVar1 = TerrorNavArea::IsPotentiallyVisible(this_00,this_01,false), cVar1 != '\0'))) {
      NDebugOverlay::HorzArrow
                ((Vector *)&local_28,(Vector *)(this_01 + 0x2c),10.0,0xff,0xff,0,0xff,true,0.01023);
      local_28 = *(undefined4 *)(this_01 + 0x2c);
      local_24 = *(undefined4 *)(this_01 + 0x30);
      local_20 = *(undefined4 *)(this_01 + 0x34);
      *(int *)(this_01 + 0x3c) = CNavArea::m_masterMarker;
    }
  }
  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)