L L4D2node

CTerrorPlayerAnimState::HandleActivity_Death

0x00510f30 · 344 bytes · __thiscall

_ZN22CTerrorPlayerAnimState20HandleActivity_DeathEv

Decompiled

undefined (1 param)

/* CTerrorPlayerAnimState::HandleActivity_Death() */

undefined4 __thiscall CTerrorPlayerAnimState::HandleActivity_Death(CTerrorPlayerAnimState *this)

{
  CBaseEntity *pCVar1;
  int iVar2;
  undefined4 uVar3;
  float local_24;
  float local_20;
  float local_1c;
  float local_18;
  float local_14;
  float local_10;
  
  if (this[0x155] == (CTerrorPlayerAnimState)0x0) {
    uVar3 = 0xffffffff;
  }
  else {
    iVar2 = CMultiPlayerAnimState::GetMainActivity((CMultiPlayerAnimState *)this);
    if ((iVar2 != 0x29b) &&
       (iVar2 = CMultiPlayerAnimState::GetMainActivity((CMultiPlayerAnimState *)this),
       iVar2 != 0x29d)) {
      (**(code **)(*(int *)this + 0x38))(this);
      pCVar1 = *(CBaseEntity **)(this + 0x118);
      iVar2 = CBaseEntity::GetTeamNumber(pCVar1);
      if ((iVar2 == 3) && (iVar2 = (**(code **)(*(int *)pCVar1 + 0x544))(pCVar1), iVar2 == 8)) {
        pCVar1 = *(CBaseEntity **)(this + 0x118);
        if (((byte)pCVar1[0x14d] & 0x10) != 0) {
          CBaseEntity::CalcAbsoluteVelocity(pCVar1);
        }
        local_24 = *(float *)(pCVar1 + 0x274);
        local_20 = *(float *)(pCVar1 + 0x278);
        if (50.0 < SQRT(local_20 * local_20 + local_24 * local_24)) {
          local_1c = 0.0;
          VectorNormalize((Vector *)&local_24);
          CBasePlayer::EyeVectors
                    (*(CBasePlayer **)(this + 0x118),(Vector *)&local_18,(Vector *)0x0,(Vector *)0x0
                    );
          if (0.7 < local_20 * local_14 + local_24 * local_18 + local_1c * local_10) {
            return 0x29d;
          }
        }
      }
      return 0x29b;
    }
    uVar3 = CMultiPlayerAnimState::GetMainActivity((CMultiPlayerAnimState *)this);
  }
  return uVar3;
}

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)