L L4D2node

CTerrorPlayerAnimState::DumpInternalState

0x00516160 · 2232 bytes · __thiscall

_ZN22CTerrorPlayerAnimState17DumpInternalStateEv

Decompiled

undefined (1 param)

/* CTerrorPlayerAnimState::DumpInternalState() */

void __thiscall CTerrorPlayerAnimState::DumpInternalState(CTerrorPlayerAnimState *this)

{
  CBaseEntity *pCVar1;
  char *pcVar2;
  char *pcVar3;
  char *pcVar4;
  char cVar5;
  int iVar6;
  undefined4 uVar7;
  char *pcVar8;
  char *pcVar9;
  CBaseEntity *pCVar10;
  CStudioHdr *pCVar11;
  int in_GS_OFFSET;
  longdouble lVar12;
  longdouble lVar13;
  longdouble lVar14;
  double dVar15;
  double dVar16;
  undefined4 uVar17;
  float local_ac;
  float local_a8;
  char local_a0 [128];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  pCVar10 = *(CBaseEntity **)(this + 0x118);
  pCVar11 = *(CStudioHdr **)(pCVar10 + 0x13e0);
  if (pCVar11 == (CStudioHdr *)0x0) {
    iVar6 = CBaseEntity::GetModel(pCVar10);
    if (iVar6 == 0) {
      pCVar11 = *(CStudioHdr **)(pCVar10 + 0x13e0);
    }
    else {
      CBaseAnimating::LockStudioHdr((CBaseAnimating *)pCVar10);
      pCVar11 = *(CStudioHdr **)(pCVar10 + 0x13e0);
    }
    if (pCVar11 == (CStudioHdr *)0x0) goto LAB_0051689f;
  }
  if (*(int *)pCVar11 == 0) goto LAB_0051689f;
  CMultiPlayerAnimState::GetOuterAbsVelocity((CMultiPlayerAnimState *)this,(Vector *)&local_ac);
  iVar6 = CBaseEntity::GetTeamNumber(*(CBaseEntity **)(this + 0x118));
  cVar5 = IsASurvivorTeam(iVar6);
  if (cVar5 == '\0') {
    uVar7 = (**(code **)(**(int **)(this + 0x118) + 0x544))(*(int **)(this + 0x118));
    pcVar8 = (char *)ZombieClassName(uVar7);
  }
  else {
    pcVar8 = (char *)SurvivorCharacterDisplayName(*(undefined4 *)(*(int *)(this + 0x118) + 0x2ba0));
  }
  V_strncpy(local_a0,pcVar8,0x80);
  PrintAndLog((void *)0x0,"\n");
  if (*(int *)(*(int *)(this + 0x118) + 0x30) == 0) {
    iVar6 = 0;
  }
  else {
    iVar6 = *(int *)(*(int *)(this + 0x118) + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
  }
  PrintAndLog((void *)0x0,"--- Dumping state for entity %d - (frame: %d) %s\n",iVar6,
              *(undefined4 *)(gpGlobals + 4),"SERVER");
  PrintAndLog((void *)0x0,"   %s\n",local_a0);
  dVar16 = (double)*(float *)(*(int *)(this + 0x118) + 0x2b20);
  dVar15 = (double)*(float *)(*(int *)(this + 0x118) + 0x490);
  iVar6 = CMultiPlayerAnimState::GetMainActivity((CMultiPlayerAnimState *)this);
  uVar7 = ActivityList_NameForIndex(iVar6);
  PrintAndLog((void *)0x0,"   %s (%2.2f) %2.2f\n",uVar7,SUB84(dVar15,0),
              (int)((ulonglong)dVar15 >> 0x20),SUB84(dVar16,0),(int)((ulonglong)dVar16 >> 0x20));
  iVar6 = *(int *)(*(int *)(this + 0x118) + 0x494);
  uVar7 = GetSequenceName(pCVar11,iVar6);
  PrintAndLog((void *)0x0,"   %s (%d)\n",uVar7,iVar6);
  pCVar10 = *(CBaseEntity **)(this + 0x118);
  if (((byte)pCVar10[0x14d] & 8) == 0) {
    dVar15 = (double)*(float *)(pCVar10 + 0x2e8);
LAB_0051632d:
    dVar16 = (double)*(float *)(pCVar10 + 0x2e4);
  }
  else {
    CBaseEntity::CalcAbsolutePosition(pCVar10);
    pCVar1 = pCVar10 + 0x2e8;
    pCVar10 = *(CBaseEntity **)(this + 0x118);
    dVar15 = (double)*(float *)pCVar1;
    if (((byte)pCVar10[0x14d] & 8) == 0) goto LAB_0051632d;
    CBaseEntity::CalcAbsolutePosition(pCVar10);
    pCVar1 = pCVar10 + 0x2e4;
    pCVar10 = *(CBaseEntity **)(this + 0x118);
    dVar16 = (double)*(float *)pCVar1;
    if (((byte)pCVar10[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(pCVar10);
    }
  }
  PrintAndLog((void *)0x0,"   Loc: %2.2f %2.2f %2.2f\n",SUB84((double)*(float *)(pCVar10 + 0x2e0),0)
              ,(int)((ulonglong)(double)*(float *)(pCVar10 + 0x2e0) >> 0x20),SUB84(dVar16,0),
              (int)((ulonglong)dVar16 >> 0x20),SUB84(dVar15,0),(int)((ulonglong)dVar15 >> 0x20));
  pCVar10 = *(CBaseEntity **)(this + 0x118);
  if (((byte)pCVar10[0x14d] & 8) == 0) {
    dVar15 = (double)*(float *)(pCVar10 + 0x380);
LAB_00516387:
    dVar16 = (double)*(float *)(pCVar10 + 0x37c);
  }
  else {
    CBaseEntity::CalcAbsolutePosition(pCVar10);
    pCVar1 = pCVar10 + 0x380;
    pCVar10 = *(CBaseEntity **)(this + 0x118);
    dVar15 = (double)*(float *)pCVar1;
    if (((byte)pCVar10[0x14d] & 8) == 0) goto LAB_00516387;
    CBaseEntity::CalcAbsolutePosition(pCVar10);
    pCVar1 = pCVar10 + 0x37c;
    pCVar10 = *(CBaseEntity **)(this + 0x118);
    dVar16 = (double)*(float *)pCVar1;
    if (((byte)pCVar10[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(pCVar10);
    }
  }
  PrintAndLog((void *)0x0,"   Rot: %2.2f %2.2f %2.2f\n",SUB84((double)*(float *)(pCVar10 + 900),0),
              (int)((ulonglong)(double)*(float *)(pCVar10 + 900) >> 0x20),SUB84(dVar16,0),
              (int)((ulonglong)dVar16 >> 0x20),SUB84(dVar15,0),(int)((ulonglong)dVar15 >> 0x20));
  lVar12 = (longdouble)(**(code **)(*(int *)this + 0x6c))(this);
  dVar15 = (double)SQRT(local_ac * local_ac + local_a8 * local_a8);
  PrintAndLog((void *)0x0,"   Speed: %2.2f (%2.2f max)\n",SUB84(dVar15,0),
              (int)((ulonglong)dVar15 >> 0x20),SUB84((double)(float)lVar12,0),
              (int)((ulonglong)(double)(float)lVar12 >> 0x20));
  PrintAndLog((void *)0x0,"   EyeYaw: %2.2f, FeetYaw: %2.2f, GoalFeetYaw: %2.2f\n",
              SUB84((double)*(float *)(this + 0xe4),0),
              (int)((ulonglong)(double)*(float *)(this + 0xe4) >> 0x20),
              SUB84((double)*(float *)(this + 0xf0),0),
              (int)((ulonglong)(double)*(float *)(this + 0xf0) >> 0x20),
              SUB84((double)*(float *)(this + 0xec),0),
              (int)((ulonglong)(double)*(float *)(this + 0xec) >> 0x20));
  PrintAndLog((void *)0x0,"   --- PoseParams ---\n");
  lVar12 = (longdouble)
           CBaseAnimating::GetPoseParameter
                     (*(CBaseAnimating **)(this + 0x118),*(int *)(this + 0x34));
  lVar13 = (longdouble)
           CBaseAnimating::GetPoseParameter
                     (*(CBaseAnimating **)(this + 0x118),*(int *)(this + 0x30));
  PrintAndLog((void *)0x0,"   Move: %2.2f %2.2f\n",SUB84((double)(float)lVar13,0),
              (int)((ulonglong)(double)(float)lVar13 >> 0x20),SUB84((double)(float)lVar12,0),
              (int)((ulonglong)(double)(float)lVar12 >> 0x20));
  lVar12 = (longdouble)
           CBaseAnimating::GetPoseParameter
                     (*(CBaseAnimating **)(this + 0x118),*(int *)(this + 0x4c));
  lVar13 = (longdouble)
           CBaseAnimating::GetPoseParameter
                     (*(CBaseAnimating **)(this + 0x118),*(int *)(this + 0x44));
  PrintAndLog((void *)0x0,"   Yaw: %2.2f %2.2f\n",SUB84((double)(float)lVar13,0),
              (int)((ulonglong)(double)(float)lVar13 >> 0x20),SUB84((double)(float)lVar12,0),
              (int)((ulonglong)(double)(float)lVar12 >> 0x20));
  lVar12 = (longdouble)
           CBaseAnimating::GetPoseParameter
                     (*(CBaseAnimating **)(this + 0x118),*(int *)(this + 0x48));
  lVar13 = (longdouble)
           CBaseAnimating::GetPoseParameter
                     (*(CBaseAnimating **)(this + 0x118),*(int *)(this + 0x40));
  PrintAndLog((void *)0x0,"   Pitch: %2.2f %2.2f\n",SUB84((double)(float)lVar13,0),
              (int)((ulonglong)(double)(float)lVar13 >> 0x20),SUB84((double)(float)lVar12,0),
              (int)((ulonglong)(double)(float)lVar12 >> 0x20));
  lVar12 = (longdouble)
           CBaseAnimating::GetPoseParameter
                     (*(CBaseAnimating **)(this + 0x118),*(int *)(this + 0x50));
  PrintAndLog((void *)0x0,"   Dismount: %2.2f\n",SUB84((double)(float)lVar12,0),
              (int)((ulonglong)(double)(float)lVar12 >> 0x20));
  lVar12 = (longdouble)
           CBaseAnimating::GetPoseParameter
                     (*(CBaseAnimating **)(this + 0x118),*(int *)(this + 0x58));
  lVar13 = (longdouble)
           CBaseAnimating::GetPoseParameter
                     (*(CBaseAnimating **)(this + 0x118),*(int *)(this + 0x5c));
  lVar14 = (longdouble)
           CBaseAnimating::GetPoseParameter
                     (*(CBaseAnimating **)(this + 0x118),*(int *)(this + 0x54));
  dVar15 = (double)(float)lVar12;
  dVar16 = (double)(float)lVar13;
  PrintAndLog((void *)0x0,"   TongleAngle: %2.2f, H/V Velocities: %2.2f %2.2f\n",
              SUB84((double)(float)lVar14,0),(int)((ulonglong)(double)(float)lVar14 >> 0x20),
              SUB84(dVar16,0),(int)((ulonglong)dVar16 >> 0x20),SUB84(dVar15,0),
              (int)((ulonglong)dVar15 >> 0x20));
  uVar7 = (undefined4)((ulonglong)dVar16 >> 0x20);
  PrintAndLog((void *)0x0,"   --- Flags ---\n");
  uVar17 = (undefined4)((ulonglong)dVar15 >> 0x20);
  pcVar8 = "ACT_MP_GESTURE_VC_NODYES";
  pcVar9 = "ACT_MP_GESTURE_VC_NODYES";
  pcVar2 = "ACT_MP_GESTURE_VC_NODYES";
  if (*(int *)(this + 0x17c) == -1) {
    pcVar8 = "ACT_MP_GESTURE_VC_NODNO";
  }
  if (this[0x14c] == (CTerrorPlayerAnimState)0x0) {
    pcVar9 = "ACT_MP_GESTURE_VC_NODNO";
  }
  if (this[0x155] == (CTerrorPlayerAnimState)0x0) {
    pcVar2 = "ACT_MP_GESTURE_VC_NODNO";
  }
  PrintAndLog((void *)0x0,"   Dead: %s, InAir: %s, Stagger: %s\n",pcVar2 + 0x15,pcVar9 + 0x15,
              pcVar8 + 0x15,uVar7,SUB84(dVar15,0),uVar17);
  pcVar8 = "ACT_MP_GESTURE_VC_NODYES";
  pcVar9 = "ACT_MP_GESTURE_VC_NODYES";
  pcVar2 = "ACT_MP_GESTURE_VC_NODYES";
  if (this[0x16a] == (CTerrorPlayerAnimState)0x0) {
    pcVar8 = "ACT_MP_GESTURE_VC_NODNO";
  }
  pcVar8 = pcVar8 + 0x15;
  if (this[0x169] == (CTerrorPlayerAnimState)0x0) {
    pcVar9 = "ACT_MP_GESTURE_VC_NODNO";
  }
  pcVar9 = pcVar9 + 0x15;
  if (this[0x15d] == (CTerrorPlayerAnimState)0x0) {
    pcVar2 = "ACT_MP_GESTURE_VC_NODNO";
  }
  pcVar3 = "ACT_MP_GESTURE_VC_NODYES";
  if (this[0x159] == (CTerrorPlayerAnimState)0x0) {
    pcVar3 = "ACT_MP_GESTURE_VC_NODNO";
  }
  pcVar4 = "ACT_MP_GESTURE_VC_NODYES";
  if (this[0x158] == (CTerrorPlayerAnimState)0x0) {
    pcVar4 = "ACT_MP_GESTURE_VC_NODNO";
  }
  PrintAndLog((void *)0x0,"   Charged: %s, Pummeled: %s, Pounded: %s, Pummeling: %s, Pounding: %s\n"
              ,pcVar4 + 0x15,pcVar3 + 0x15,pcVar2 + 0x15,pcVar9,pcVar8,uVar17);
  pcVar2 = "ACT_MP_GESTURE_VC_NODYES";
  pcVar3 = "ACT_MP_GESTURE_VC_NODYES";
  pcVar4 = "ACT_MP_GESTURE_VC_NODYES";
  if (this[0x162] == (CTerrorPlayerAnimState)0x0) {
    pcVar2 = "ACT_MP_GESTURE_VC_NODNO";
  }
  if (this[0x161] == (CTerrorPlayerAnimState)0x0) {
    pcVar3 = "ACT_MP_GESTURE_VC_NODNO";
  }
  if (this[0x15f] == (CTerrorPlayerAnimState)0x0) {
    pcVar4 = "ACT_MP_GESTURE_VC_NODNO";
  }
  PrintAndLog((void *)0x0,"   TankPunched: %s, Pounced: %s, Tongued: %s\n",pcVar4 + 0x15,
              pcVar3 + 0x15,pcVar2 + 0x15,pcVar9,pcVar8,uVar17);
  pcVar8 = "ACT_MP_GESTURE_VC_NODYES";
  pcVar9 = "ACT_MP_GESTURE_VC_NODYES";
  pcVar2 = "ACT_MP_GESTURE_VC_NODYES";
  if (this[0x16c] == (CTerrorPlayerAnimState)0x0) {
    pcVar8 = "ACT_MP_GESTURE_VC_NODNO";
  }
  pcVar8 = pcVar8 + 0x15;
  if (this[0x16b] == (CTerrorPlayerAnimState)0x0) {
    pcVar9 = "ACT_MP_GESTURE_VC_NODNO";
  }
  pcVar9 = pcVar9 + 0x15;
  pcVar3 = "ACT_MP_GESTURE_VC_NODYES";
  if (this[0x168] == (CTerrorPlayerAnimState)0x0) {
    pcVar3 = "ACT_MP_GESTURE_VC_NODNO";
  }
  if (this[0x167] == (CTerrorPlayerAnimState)0x0) {
    pcVar2 = "ACT_MP_GESTURE_VC_NODNO";
  }
  pcVar4 = "ACT_MP_GESTURE_VC_NODYES";
  if (this[0x164] == (CTerrorPlayerAnimState)0x0) {
    pcVar4 = "ACT_MP_GESTURE_VC_NODNO";
  }
  PrintAndLog((void *)0x0,
              "   Pouncing: %s, Tonguing: %s, Charging: %s, TongueReeling: %s, TongueAttacking: %s\n"
              ,pcVar4 + 0x15,pcVar2 + 0x15,pcVar3 + 0x15,pcVar9,pcVar8);
  pcVar2 = "ACT_MP_GESTURE_VC_NODYES";
  pcVar3 = "ACT_MP_GESTURE_VC_NODYES";
  pcVar4 = "ACT_MP_GESTURE_VC_NODYES";
  if (*(int *)(this + 0x178) == -1) {
    pcVar2 = "ACT_MP_GESTURE_VC_NODNO";
  }
  if (*(int *)(this + 0x174) == -1) {
    pcVar3 = "ACT_MP_GESTURE_VC_NODNO";
  }
  if (*(int *)(this + 0x17c) == -1) {
    pcVar4 = "ACT_MP_GESTURE_VC_NODNO";
  }
  PrintAndLog((void *)0x0,"   RockThrow: %s, Climb: %s, Rage: %s\n",pcVar4 + 0x15,pcVar3 + 0x15,
              pcVar2 + 0x15,pcVar9,pcVar8);
LAB_0051689f:
  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)