L L4D2node

CSurvivorRescue::DrawDebugTextOverlays

0x0096b170 · 986 bytes · __thiscall

_ZN15CSurvivorRescue21DrawDebugTextOverlaysEv

Decompiled

undefined (1 param)

/* CSurvivorRescue::DrawDebugTextOverlays() */

int __thiscall CSurvivorRescue::DrawDebugTextOverlays(CSurvivorRescue *this)

{
  uint uVar1;
  code *pcVar2;
  char cVar3;
  char *pcVar4;
  undefined4 uVar5;
  int *piVar6;
  undefined *puVar7;
  int in_GS_OFFSET;
  int iVar8;
  int iVar9;
  int local_130;
  undefined **local_12c;
  undefined1 local_128;
  undefined1 local_127;
  undefined4 local_24;
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  local_130 = CBaseAnimating::DrawDebugTextOverlays((CBaseAnimating *)this);
  if (((byte)this[0x110] & 1) != 0) {
    local_12c = &PTR_InitQuietTruncation_00c08ee8;
    local_128 = 1;
    local_127 = 0;
    local_24 = 0;
    pcVar4 = (char *)CFmtStrN<256>::sprintf
                               ((CFmtStrN<256> *)&local_12c,"%d survivors rescued here",
                                *(undefined4 *)(this + 0x1934));
    CBaseEntity::EntityText((CBaseEntity *)this,local_130,pcVar4,0.0,0xff,0xff,0xff,0xff);
    cVar3 = IsCallingForHelp(this);
    if (cVar3 == '\0') {
      pcVar4 = (char *)CFmtStrN<256>::sprintf((CFmtStrN<256> *)&local_12c,"Not calling for rescue");
      iVar9 = 0;
      iVar8 = 0xff;
    }
    else {
      uVar1 = *(uint *)(this + 0x1920);
      piVar6 = (int *)0x0;
      if (((uVar1 != 0xffffffff) &&
          (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
        piVar6 = *(int **)(puVar7 + 4);
      }
      uVar5 = (**(code **)(*piVar6 + 0xb8))(piVar6);
      pcVar4 = (char *)CFmtStrN<256>::sprintf
                                 ((CFmtStrN<256> *)&local_12c,"Calling for rescue for %s",uVar5);
      iVar9 = 0xff;
      iVar8 = 0;
    }
    CBaseEntity::EntityText((CBaseEntity *)this,local_130 + 1,pcVar4,0.0,iVar8,iVar9,0,0xff);
    pcVar4 = (char *)CFmtStrN<256>::sprintf
                               ((CFmtStrN<256> *)&local_12c,"flow distance: %.0f",
                                (double)*(float *)(this + 0x1930));
    CBaseEntity::EntityText((CBaseEntity *)this,local_130 + 2,pcVar4,0.0,0xff,0xff,0,0xff);
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
    iVar9 = CNavMesh::GetNearestNavArea
                      (TheNavMesh,(Vector *)(this + 0x2e0),false,10000.0,false,true,false);
    iVar8 = local_130 + 3;
    if (iVar9 != 0) {
      pcVar4 = (char *)CFmtStrN<256>::sprintf
                                 ((CFmtStrN<256> *)&local_12c,"area: %d",
                                  *(undefined4 *)(iVar9 + 0x8c));
      CBaseEntity::EntityText((CBaseEntity *)this,local_130 + 3,pcVar4,0.0,0xff,0xff,0xff,0xff);
      iVar8 = local_130 + 4;
    }
    local_130 = iVar8;
    iVar8 = 0;
    if (0 < *(int *)(this + 0x1950)) {
      do {
        uVar1 = *(uint *)(*(int *)(this + 0x1944) + iVar8 * 4);
        if (((uVar1 != 0xffffffff) &&
            (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
           ((*(uint *)(puVar7 + 8) == uVar1 >> 0xc &&
            (piVar6 = *(int **)(puVar7 + 4), piVar6 != (int *)0x0)))) {
          pcVar2 = *(code **)(*debugoverlay + 0xc);
          uVar5 = (**(code **)(*piVar6 + 0x288))(piVar6);
          if (((byte)this[0x14d] & 8) != 0) {
            CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
          }
          (*pcVar2)(debugoverlay,(Vector *)(this + 0x2e0),uVar5,0xff,0,0,1,0x3dcccccd);
        }
        iVar8 = iVar8 + 1;
      } while (iVar8 < *(int *)(this + 0x1950));
    }
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return local_130;
}

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)