L L4D2node

CTerrorPlayer::UpdatePound

0x009fa2b0 · 761 bytes · __thiscall

_ZN13CTerrorPlayer11UpdatePoundEv

Decompiled

undefined (1 param)

/* CTerrorPlayer::UpdatePound() */

void __thiscall CTerrorPlayer::UpdatePound(CTerrorPlayer *this)

{
  float fVar1;
  float fVar2;
  uint uVar3;
  CBaseEdict *this_00;
  CBaseEntity *this_01;
  char cVar4;
  int iVar5;
  undefined *puVar6;
  uint uVar7;
  undefined4 *puVar8;
  CTerrorPlayer *pCVar9;
  float fVar10;
  float local_18;
  float local_14;
  float local_10;
  
  uVar3 = *(uint *)(this + 0x3e4c);
  if (uVar3 == 0xffffffff) {
LAB_009fa2e8:
    uVar3 = *(uint *)(this + 0x3e48);
    if (((uVar3 != 0xffffffff) &&
        (puVar6 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
       ((*(uint *)(puVar6 + 8) == uVar3 >> 0xc &&
        (this_01 = *(CBaseEntity **)(puVar6 + 4), this_01 != (CBaseEntity *)0x0)))) {
      if (((byte)this_01[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(this_01);
      }
      fVar10 = *(float *)(this_01 + 0x2e0);
      fVar1 = *(float *)(this_01 + 0x2e4);
      fVar2 = *(float *)(this_01 + 0x2e8);
      if (((byte)this[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
      }
      local_14 = (*(float *)(this + 0x2e4) - fVar1) * 0.8 + fVar1;
      local_10 = (*(float *)(this + 0x2e8) - fVar2) * 0.8 + fVar2;
      local_18 = (*(float *)(this + 0x2e0) - fVar10) * 0.8 + fVar10;
      CBaseEntity::SetAbsOrigin((CBaseEntity *)this,(Vector *)&local_18);
      CBaseEntity::SetAbsVelocity((CBaseEntity *)this,(Vector *)&vec3_origin);
      return;
    }
    return;
  }
  uVar7 = uVar3 & 0xfff;
  puVar8 = (undefined4 *)(g_pEntityList + uVar7 * 0x10 + 4);
  if (((puVar8 == (undefined4 *)0x0) ||
      (*(uint *)(g_pEntityList + uVar7 * 0x10 + 8) != uVar3 >> 0xc)) ||
     (*(int *)(g_pEntityList + uVar7 * 0x10 + 4) == 0)) goto LAB_009fa2e8;
  fVar10 = *(float *)(this + 0x3e50);
  if (fVar10 == -1.0) {
    cVar4 = IsStaggering(this);
    if (cVar4 != '\0') {
      return;
    }
    uVar3 = *(uint *)(this + 0x3e4c);
    pCVar9 = (CTerrorPlayer *)0x0;
    if (((uVar3 == 0xffffffff) ||
        (puVar8 = (undefined4 *)(g_pEntityList + (uVar3 & 0xfff) * 0x10 + 4),
        puVar8 == (undefined4 *)0x0)) || (puVar8[1] != uVar3 >> 0xc)) goto LAB_009fa34b;
  }
  else if (*(float *)(gpGlobals + 0xc) <= fVar10 && fVar10 != *(float *)(gpGlobals + 0xc)) {
    return;
  }
  pCVar9 = (CTerrorPlayer *)*puVar8;
LAB_009fa34b:
  CBaseEntity::RemoveFlag((CBaseEntity *)this,0x20);
  QueuePummelVictim(this,(CTerrorPlayer *)0x0,-1.0);
  *(undefined4 *)(pCVar9 + 0x3e54) = 0xffffffff;
  cVar4 = (**(code **)(*(int *)pCVar9 + 300))(pCVar9);
  if (cVar4 == '\0') {
    return;
  }
  cVar4 = (**(code **)(*(int *)this + 300))(this);
  if (cVar4 == '\0') {
    return;
  }
  OnStartPummelingSurvivor(this,pCVar9);
  (**(code **)(*(int *)this + 0x7fc))(this,0x4a,0);
  (**(code **)(*(int *)pCVar9 + 0x7fc))(pCVar9,0x4e,0);
  CBaseEntity::EmitSound((CBaseEntity *)this,"ChargerZombie.VocalizePummel",0.0,(float *)0x0);
  fVar10 = *(float *)(gpGlobals + 0xc) + 5.0;
  if (fVar10 == *(float *)(this + 0x401c)) {
    return;
  }
  if (this[0x6c] == (CTerrorPlayer)0x0) {
    this_00 = *(CBaseEdict **)(this + 0x30);
    if (this_00 != (CBaseEdict *)0x0) {
      *(uint *)this_00 = *(uint *)this_00 | 0x101;
      iVar5 = CBaseEdict::GetChangeAccessor(this_00);
      *(undefined2 *)(iVar5 + 2) = 0;
    }
  }
  else {
    this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
  }
  *(float *)(this + 0x401c) = fVar10;
  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)