L L4D2node

CTerrorPlayerAnimState::DebugShowAnimState

0x00515010 · 4270 bytes · __thiscall

_ZN22CTerrorPlayerAnimState18DebugShowAnimStateEiP10CStudioHdrb

Decompiled

undefined (4 params)

/* CTerrorPlayerAnimState::DebugShowAnimState(int, CStudioHdr*, bool) */

void __thiscall
CTerrorPlayerAnimState::DebugShowAnimState
          (CTerrorPlayerAnimState *this,int param_1,CStudioHdr *param_2,bool param_3)

{
  CBaseEntity *pCVar1;
  float fVar2;
  float fVar3;
  int *piVar4;
  code *pcVar5;
  uint uVar6;
  char *pcVar7;
  char *pcVar8;
  char *pcVar9;
  char *pcVar10;
  char *pcVar11;
  char cVar12;
  int iVar13;
  char *pcVar14;
  undefined4 uVar15;
  CBaseEntity *pCVar16;
  int in_GS_OFFSET;
  longdouble lVar17;
  longdouble lVar18;
  longdouble lVar19;
  double dVar20;
  double dVar21;
  float fVar22;
  float local_100;
  float local_fc;
  undefined4 local_f4;
  undefined4 local_f0;
  undefined4 local_ec;
  float local_e8;
  float local_e4;
  float local_e0;
  float local_dc;
  float local_d8;
  float local_d4;
  Vector local_d0 [12];
  float local_c4;
  float local_c0;
  float local_bc;
  float local_b8;
  float local_b4;
  float local_b0;
  float local_ac;
  float local_a8;
  float local_a4;
  char local_a0 [128];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  uVar6 = -(uint)!param_3;
  CMultiPlayerAnimState::GetOuterAbsVelocity((CMultiPlayerAnimState *)this,(Vector *)&local_100);
  iVar13 = CBaseEntity::GetTeamNumber(*(CBaseEntity **)(this + 0x118));
  cVar12 = IsASurvivorTeam(iVar13);
  piVar4 = *(int **)(this + 0x118);
  if (cVar12 == '\0') {
    uVar15 = (**(code **)(*piVar4 + 0x544))(piVar4);
    pcVar14 = (char *)ZombieClassName(uVar15);
  }
  else {
    pcVar14 = (char *)SurvivorCharacterDisplayName(piVar4[0xae8]);
  }
  V_strncpy(local_a0,pcVar14,0x80);
  pcVar14 = "SERVER";
  if (!param_3) {
    pcVar14 = "CLIENT";
  }
  (**(code **)(*engine + 0xbc))
            (engine,(uVar6 & 0xffffffec) + 0x19,
             "-------------- %s - %s (%d): frame %d (%dms) --------------",pcVar14,local_a0,param_1,
             *(undefined4 *)(gpGlobals + 4),(int)(*(float *)(gpGlobals + 0x10) * 1000.0));
  pcVar5 = *(code **)(*engine + 0xbc);
  fVar2 = *(float *)(*(int *)(this + 0x118) + 0x2b20);
  fVar3 = *(float *)(*(int *)(this + 0x118) + 0x490);
  iVar13 = CMultiPlayerAnimState::GetMainActivity((CMultiPlayerAnimState *)this);
  uVar15 = ActivityList_NameForIndex(iVar13);
  (*pcVar5)(engine,(uVar6 & 0xffffffec) + 0x1a,"%s (%2.2f) %2.2f",uVar15,(double)fVar3,(double)fVar2
           );
  pcVar5 = *(code **)(*engine + 0xbc);
  iVar13 = *(int *)(*(int *)(this + 0x118) + 0x494);
  uVar15 = GetSequenceName(param_2,iVar13);
  (*pcVar5)(engine,(uVar6 & 0xffffffec) + 0x1b,"%s (%d)",uVar15,iVar13);
  pCVar16 = *(CBaseEntity **)(this + 0x118);
  pcVar5 = *(code **)(*engine + 0xbc);
  if (((byte)pCVar16[0x14d] & 8) == 0) {
    dVar21 = (double)*(float *)(pCVar16 + 0x2e8);
LAB_00515385:
    dVar20 = (double)*(float *)(pCVar16 + 0x2e4);
  }
  else {
    CBaseEntity::CalcAbsolutePosition(pCVar16);
    pCVar1 = pCVar16 + 0x2e8;
    pCVar16 = *(CBaseEntity **)(this + 0x118);
    dVar21 = (double)*(float *)pCVar1;
    if (((byte)pCVar16[0x14d] & 8) == 0) goto LAB_00515385;
    CBaseEntity::CalcAbsolutePosition(pCVar16);
    pCVar1 = pCVar16 + 0x2e4;
    pCVar16 = *(CBaseEntity **)(this + 0x118);
    dVar20 = (double)*(float *)pCVar1;
    if (((byte)pCVar16[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(pCVar16);
    }
  }
  (*pcVar5)(engine,(uVar6 & 0xffffffec) + 0x1c,"Loc: %2.2f %2.2f %2.2f",
            (double)*(float *)(pCVar16 + 0x2e0),SUB84(dVar20,0),(int)((ulonglong)dVar20 >> 0x20),
            SUB84(dVar21,0),(int)((ulonglong)dVar21 >> 0x20));
  pCVar16 = *(CBaseEntity **)(this + 0x118);
  pcVar5 = *(code **)(*engine + 0xbc);
  if (((byte)pCVar16[0x14d] & 8) == 0) {
    dVar21 = (double)*(float *)(pCVar16 + 0x380);
  }
  else {
    CBaseEntity::CalcAbsolutePosition(pCVar16);
    pCVar1 = pCVar16 + 0x380;
    pCVar16 = *(CBaseEntity **)(this + 0x118);
    dVar21 = (double)*(float *)pCVar1;
    if (((byte)pCVar16[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(pCVar16);
      pCVar1 = pCVar16 + 0x37c;
      pCVar16 = *(CBaseEntity **)(this + 0x118);
      dVar20 = (double)*(float *)pCVar1;
      if (((byte)pCVar16[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(pCVar16);
      }
      goto LAB_005153fa;
    }
  }
  dVar20 = (double)*(float *)(pCVar16 + 0x37c);
LAB_005153fa:
  (*pcVar5)(engine,(uVar6 & 0xffffffec) + 0x1d,"Rot: %2.2f %2.2f %2.2f",
            (double)*(float *)(pCVar16 + 900),SUB84(dVar20,0),(int)((ulonglong)dVar20 >> 0x20),
            SUB84(dVar21,0),(int)((ulonglong)dVar21 >> 0x20));
  pcVar5 = *(code **)(*engine + 0xbc);
  lVar17 = (longdouble)(**(code **)(*(int *)this + 0x6c))(this);
  (*pcVar5)(engine,(uVar6 & 0xffffffec) + 0x1e,"Speed: %2.2f (%2.2f max)",
            (double)SQRT(local_100 * local_100 + local_fc * local_fc),(double)(float)lVar17);
  (**(code **)(*engine + 0xbc))
            (engine,(uVar6 & 0xffffffec) + 0x1f,"EyeYaw: %2.2f, FeetYaw: %2.2f, GoalFeetYaw: %2.2f",
             (double)*(float *)(this + 0xe4),(double)*(float *)(this + 0xf0),
             (double)*(float *)(this + 0xec));
  (**(code **)(*engine + 0xbc))(engine,(uVar6 & 0xffffffec) + 0x20,"--- PoseParams ---");
  pcVar5 = *(code **)(*engine + 0xbc);
  lVar17 = (longdouble)
           CBaseAnimating::GetPoseParameter
                     (*(CBaseAnimating **)(this + 0x118),*(int *)(this + 0x34));
  lVar18 = (longdouble)
           CBaseAnimating::GetPoseParameter
                     (*(CBaseAnimating **)(this + 0x118),*(int *)(this + 0x30));
  (*pcVar5)(engine,(uVar6 & 0xffffffec) + 0x21,"Move: %2.2f %2.2f",(double)(float)lVar18,
            (double)(float)lVar17);
  pcVar5 = *(code **)(*engine + 0xbc);
  lVar17 = (longdouble)
           CBaseAnimating::GetPoseParameter
                     (*(CBaseAnimating **)(this + 0x118),*(int *)(this + 0x4c));
  lVar18 = (longdouble)
           CBaseAnimating::GetPoseParameter
                     (*(CBaseAnimating **)(this + 0x118),*(int *)(this + 0x44));
  (*pcVar5)(engine,(uVar6 & 0xffffffec) + 0x22,"Yaw: %2.2f %2.2f",(double)(float)lVar18,
            (double)(float)lVar17);
  pcVar5 = *(code **)(*engine + 0xbc);
  lVar17 = (longdouble)
           CBaseAnimating::GetPoseParameter
                     (*(CBaseAnimating **)(this + 0x118),*(int *)(this + 0x48));
  lVar18 = (longdouble)
           CBaseAnimating::GetPoseParameter
                     (*(CBaseAnimating **)(this + 0x118),*(int *)(this + 0x40));
  (*pcVar5)(engine,(uVar6 & 0xffffffec) + 0x23,"Pitch: %2.2f %2.2f",(double)(float)lVar18,
            (double)(float)lVar17);
  pcVar5 = *(code **)(*engine + 0xbc);
  lVar17 = (longdouble)
           CBaseAnimating::GetPoseParameter
                     (*(CBaseAnimating **)(this + 0x118),*(int *)(this + 0x50));
  (*pcVar5)(engine,(uVar6 & 0xffffffec) + 0x24,"Dismount: %2.2f",(double)(float)lVar17);
  pcVar5 = *(code **)(*engine + 0xbc);
  lVar17 = (longdouble)
           CBaseAnimating::GetPoseParameter
                     (*(CBaseAnimating **)(this + 0x118),*(int *)(this + 0x58));
  lVar18 = (longdouble)
           CBaseAnimating::GetPoseParameter
                     (*(CBaseAnimating **)(this + 0x118),*(int *)(this + 0x5c));
  lVar19 = (longdouble)
           CBaseAnimating::GetPoseParameter
                     (*(CBaseAnimating **)(this + 0x118),*(int *)(this + 0x54));
  (*pcVar5)(engine,(uVar6 & 0xffffffec) + 0x25,"TongleAngle: %2.2f, H/V Velocities: %2.2f %2.2f",
            (double)(float)lVar19,(double)(float)lVar18,(double)(float)lVar17);
  pcVar14 = "ACT_MP_GESTURE_VC_NODYES";
  (**(code **)(*engine + 0xbc))(engine,(uVar6 & 0xffffffec) + 0x26,"--- Flags ---");
  pcVar7 = "ACT_MP_GESTURE_VC_NODYES";
  pcVar8 = "ACT_MP_GESTURE_VC_NODYES";
  if (*(int *)(this + 0x17c) == -1) {
    pcVar7 = "ACT_MP_GESTURE_VC_NODNO";
  }
  pcVar9 = "ACT_MP_GESTURE_VC_NODYES";
  if (this[0x14c] == (CTerrorPlayerAnimState)0x0) {
    pcVar9 = "ACT_MP_GESTURE_VC_NODNO";
  }
  if (this[0x155] == (CTerrorPlayerAnimState)0x0) {
    pcVar8 = "ACT_MP_GESTURE_VC_NODNO";
  }
  (**(code **)(*engine + 0xbc))
            (engine,(uVar6 & 0xffffffec) + 0x27,"Dead: %s, InAir: %s, Stagger: %s",pcVar8 + 0x15,
             pcVar9 + 0x15,pcVar7 + 0x15);
  pcVar7 = "ACT_MP_GESTURE_VC_NODYES";
  pcVar8 = "ACT_MP_GESTURE_VC_NODYES";
  if (this[0x16a] == (CTerrorPlayerAnimState)0x0) {
    pcVar7 = "ACT_MP_GESTURE_VC_NODNO";
  }
  pcVar9 = "ACT_MP_GESTURE_VC_NODYES";
  if (this[0x169] == (CTerrorPlayerAnimState)0x0) {
    pcVar9 = "ACT_MP_GESTURE_VC_NODNO";
  }
  pcVar10 = "ACT_MP_GESTURE_VC_NODYES";
  if (this[0x15d] == (CTerrorPlayerAnimState)0x0) {
    pcVar8 = "ACT_MP_GESTURE_VC_NODNO";
  }
  pcVar11 = "ACT_MP_GESTURE_VC_NODYES";
  if (this[0x159] == (CTerrorPlayerAnimState)0x0) {
    pcVar10 = "ACT_MP_GESTURE_VC_NODNO";
  }
  if (this[0x158] == (CTerrorPlayerAnimState)0x0) {
    pcVar11 = "ACT_MP_GESTURE_VC_NODNO";
  }
  (**(code **)(*engine + 0xbc))
            (engine,(uVar6 & 0xffffffec) + 0x28,
             "Charged: %s, Pummeled: %s, Pounded: %s, Pummeling: %s, Pounding: %s",pcVar11 + 0x15,
             pcVar10 + 0x15,pcVar8 + 0x15,pcVar9 + 0x15,pcVar7 + 0x15);
  pcVar7 = "ACT_MP_GESTURE_VC_NODYES";
  pcVar8 = "ACT_MP_GESTURE_VC_NODYES";
  if (this[0x162] == (CTerrorPlayerAnimState)0x0) {
    pcVar7 = "ACT_MP_GESTURE_VC_NODNO";
  }
  pcVar9 = "ACT_MP_GESTURE_VC_NODYES";
  if (this[0x161] == (CTerrorPlayerAnimState)0x0) {
    pcVar9 = "ACT_MP_GESTURE_VC_NODNO";
  }
  if (this[0x15f] == (CTerrorPlayerAnimState)0x0) {
    pcVar8 = "ACT_MP_GESTURE_VC_NODNO";
  }
  (**(code **)(*engine + 0xbc))
            (engine,(uVar6 & 0xffffffec) + 0x29,"TankPunched: %s, Pounced: %s, Tongued: %s",
             pcVar8 + 0x15,pcVar9 + 0x15,pcVar7 + 0x15);
  pcVar7 = "ACT_MP_GESTURE_VC_NODYES";
  pcVar8 = "ACT_MP_GESTURE_VC_NODYES";
  if (this[0x16c] == (CTerrorPlayerAnimState)0x0) {
    pcVar7 = "ACT_MP_GESTURE_VC_NODNO";
  }
  pcVar9 = "ACT_MP_GESTURE_VC_NODYES";
  if (this[0x16b] == (CTerrorPlayerAnimState)0x0) {
    pcVar9 = "ACT_MP_GESTURE_VC_NODNO";
  }
  pcVar10 = "ACT_MP_GESTURE_VC_NODYES";
  if (this[0x168] == (CTerrorPlayerAnimState)0x0) {
    pcVar8 = "ACT_MP_GESTURE_VC_NODNO";
  }
  pcVar11 = "ACT_MP_GESTURE_VC_NODYES";
  if (this[0x167] == (CTerrorPlayerAnimState)0x0) {
    pcVar10 = "ACT_MP_GESTURE_VC_NODNO";
  }
  if (this[0x164] == (CTerrorPlayerAnimState)0x0) {
    pcVar11 = "ACT_MP_GESTURE_VC_NODNO";
  }
  (**(code **)(*engine + 0xbc))
            (engine,(uVar6 & 0xffffffec) + 0x2a,
             "Pouncing: %s, Tonguing: %s, Charging: %s, TongueReeling: %s, TongueAttacking: %s",
             pcVar11 + 0x15,pcVar10 + 0x15,pcVar8 + 0x15,pcVar9 + 0x15,pcVar7 + 0x15);
  pcVar7 = "ACT_MP_GESTURE_VC_NODYES";
  if (*(int *)(this + 0x178) == -1) {
    pcVar7 = "ACT_MP_GESTURE_VC_NODNO";
  }
  pcVar8 = "ACT_MP_GESTURE_VC_NODYES";
  if (*(int *)(this + 0x174) == -1) {
    pcVar8 = "ACT_MP_GESTURE_VC_NODNO";
  }
  if (*(int *)(this + 0x17c) == -1) {
    pcVar14 = "ACT_MP_GESTURE_VC_NODNO";
  }
  (**(code **)(*engine + 0xbc))
            (engine,(uVar6 & 0xffffffec) + 0x2b,"RockThrow: %s, Climb: %s, Rage: %s",pcVar14 + 0x15,
             pcVar8 + 0x15,pcVar7 + 0x15);
  pCVar16 = *(CBaseEntity **)(this + 0x1c);
  if (((byte)pCVar16[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition(pCVar16);
  }
  local_f4 = 0;
  fVar2 = *(float *)(pCVar16 + 0x2e0);
  local_ec = 0;
  fVar3 = *(float *)(pCVar16 + 0x2e4);
  fVar22 = *(float *)(pCVar16 + 0x2e8) + 3.0;
  local_f0 = *(undefined4 *)(this + 0xf0);
  AngleVectors((QAngle *)&local_f4,(Vector *)&local_e8,(Vector *)&local_dc,local_d0);
  local_a4 = local_e0 * 80.0 + fVar22;
  local_ac = local_e8 * 80.0 + fVar2;
  local_a8 = local_e4 * 80.0 + fVar3;
  local_b8 = fVar2 - local_dc * 5.0;
  local_c4 = local_dc * 5.0 + fVar2;
  local_b0 = fVar22 - local_d4 * 5.0;
  local_bc = local_d4 * 5.0 + fVar22;
  local_b4 = fVar3 - local_d8 * 5.0;
  local_c0 = local_d8 * 5.0 + fVar3;
  (**(code **)(*debugoverlay + 8))
            (debugoverlay,&local_c4,&local_b8,&local_ac,0xff,0,0,0xff,0,0x3c23d70a);
  local_f0 = *(undefined4 *)(this + 0xec);
  AngleVectors((QAngle *)&local_f4,(Vector *)&local_e8,(Vector *)&local_dc,local_d0);
  local_ac = local_e8 * 80.0 + fVar2;
  local_a8 = local_e4 * 80.0 + fVar3;
  local_a4 = local_e0 * 80.0 + fVar22;
  local_b8 = fVar2 - local_dc * 5.0;
  local_c4 = local_dc * 5.0 + fVar2;
  local_b4 = fVar3 - local_d8 * 5.0;
  local_c0 = local_d8 * 5.0 + fVar3;
  local_b0 = fVar22 - local_d4 * 5.0;
  local_bc = local_d4 * 5.0 + fVar22;
  (**(code **)(*debugoverlay + 8))
            (debugoverlay,&local_c4,&local_b8,&local_ac,0xff,0xff,0,0xff,0,0x3c23d70a);
  local_f0 = *(undefined4 *)(this + 0xe4);
  fVar22 = fVar22 + 50.0;
  AngleVectors((QAngle *)&local_f4,(Vector *)&local_e8,(Vector *)&local_dc,local_d0);
  local_a4 = local_e0 * 80.0 + fVar22;
  local_a8 = local_e4 * 80.0 + fVar3;
  local_ac = local_e8 * 80.0 + fVar2;
  local_b8 = fVar2 - local_dc * 5.0;
  local_c4 = fVar2 + local_dc * 5.0;
  local_c0 = fVar3 + local_d8 * 5.0;
  local_b4 = fVar3 - local_d8 * 5.0;
  local_bc = fVar22 + local_d4 * 5.0;
  local_b0 = fVar22 - local_d4 * 5.0;
  (**(code **)(*debugoverlay + 8))
            (debugoverlay,&local_c4,&local_b8,&local_ac,0xff,0xff,0xff,0xff,0,0x3c23d70a);
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  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)