L L4D2node

CTerrorPlayer::StartUseAction

0x009b1160 · 1192 bytes · __thiscall

_ZN13CTerrorPlayer14StartUseActionE21TerrorPlayerUseActionP11CBaseEntityfb

Decompiled

undefined (5 params)

/* CTerrorPlayer::StartUseAction(TerrorPlayerUseAction, CBaseEntity*, float, bool) */

void __thiscall
CTerrorPlayer::StartUseAction
          (CTerrorPlayer *this,int param_2,CTerrorPlayer *param_3,float param_4,char param_5)

{
  uint uVar1;
  CBaseEdict *pCVar2;
  char cVar3;
  int iVar4;
  int iVar5;
  undefined *puVar6;
  CCSPlayer *local_30;
  uint local_20 [4];
  
  if (param_3 == (CTerrorPlayer *)0x0) {
    return;
  }
  cVar3 = IsDominatedBySpecialInfected(this);
  if (cVar3 == '\0') {
    cVar3 = (**(code **)(*(int *)param_3 + 0x16c))(param_3);
    if ((cVar3 == '\0') || (cVar3 = (**(code **)(*(int *)param_3 + 0x16c))(param_3), cVar3 == '\0'))
    {
      local_30 = (CCSPlayer *)0x0;
    }
    else {
      iVar4 = GetCurrentUseAction(param_3);
      if (iVar4 != 0) {
        return;
      }
      local_30 = (CCSPlayer *)param_3;
    }
    cVar3 = IsPerformingAction(this,0);
    if ((cVar3 == '\0') && (cVar3 = IsActionBeingPerformedOnMe(this,0), cVar3 == '\0')) {
      iVar4 = CBaseEntity::GetGroundEntity((CBaseEntity *)this);
      if (iVar4 != 0) {
        CBaseEntity::SetAbsVelocity((CBaseEntity *)this,(Vector *)&vec3_origin);
        CBaseAnimating::SetSequence((CBaseAnimating *)this,0);
      }
      if (param_5 != '\0') {
        CCSPlayer::SetProgressBarTime((CCSPlayer *)this,param_4);
      }
      CHandle<CTerrorPlayer>::CHandle((CHandle<CTerrorPlayer> *)local_20,this);
      if (((local_20[0] == 0xffffffff) ||
          (puVar6 = g_pEntityList + (local_20[0] & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)
          ) || (*(uint *)(puVar6 + 8) != local_20[0] >> 0xc)) {
        iVar4 = 0;
      }
      else {
        iVar4 = *(int *)(puVar6 + 4);
      }
      uVar1 = *(uint *)(this + 0x2b40);
      if (((uVar1 == 0xffffffff) ||
          (puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
         (*(uint *)(puVar6 + 8) != uVar1 >> 0xc)) {
        iVar5 = 0;
      }
      else {
        iVar5 = *(int *)(puVar6 + 4);
      }
      if (iVar4 != iVar5) {
        if (this[0x6c] == (CTerrorPlayer)0x0) {
          pCVar2 = *(CBaseEdict **)(this + 0x30);
          if (pCVar2 != (CBaseEdict *)0x0) {
            *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
            iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
            *(undefined2 *)(iVar4 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
        }
        *(uint *)(this + 0x2b40) = local_20[0];
      }
      CHandle<CBaseEntity>::CHandle((CHandle<CBaseEntity> *)local_20,(CBaseEntity *)param_3);
      if (((local_20[0] == 0xffffffff) ||
          (puVar6 = g_pEntityList + (local_20[0] & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)
          ) || (*(uint *)(puVar6 + 8) != local_20[0] >> 0xc)) {
        iVar4 = 0;
      }
      else {
        iVar4 = *(int *)(puVar6 + 4);
      }
      uVar1 = *(uint *)(this + 0x2b3c);
      if (((uVar1 == 0xffffffff) ||
          (puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
         (*(uint *)(puVar6 + 8) != uVar1 >> 0xc)) {
        iVar5 = 0;
      }
      else {
        iVar5 = *(int *)(puVar6 + 4);
      }
      if (iVar4 != iVar5) {
        if (this[0x6c] == (CTerrorPlayer)0x0) {
          pCVar2 = *(CBaseEdict **)(this + 0x30);
          if (pCVar2 != (CBaseEdict *)0x0) {
            *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
            iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
            *(undefined2 *)(iVar4 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
        }
        *(uint *)(this + 0x2b3c) = local_20[0];
      }
      if (param_2 != *(int *)(this + 0x2b44)) {
        if (this[0x6c] == (CTerrorPlayer)0x0) {
          pCVar2 = *(CBaseEdict **)(this + 0x30);
          if (pCVar2 != (CBaseEdict *)0x0) {
            *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
            iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
            *(undefined2 *)(iVar4 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
        }
        *(int *)(this + 0x2b44) = param_2;
      }
      DoUseActionAnimationEvents(this,param_2,param_3);
      if ((local_30 != (CCSPlayer *)this) && (local_30 != (CCSPlayer *)0x0)) {
        CCSPlayer::SetProgressBarTime(local_30,param_4);
        CHandle<CTerrorPlayer>::CHandle((CHandle<CTerrorPlayer> *)local_20,this);
        if ((local_20[0] == 0xffffffff) ||
           ((puVar6 = g_pEntityList + (local_20[0] & 0xfff) * 0x10,
            puVar6 == (undefined *)0xfffffffc || (*(uint *)(puVar6 + 8) != local_20[0] >> 0xc)))) {
          iVar4 = 0;
        }
        else {
          iVar4 = *(int *)(puVar6 + 4);
        }
        uVar1 = *(uint *)(local_30 + 0x2b40);
        if (((uVar1 == 0xffffffff) ||
            (puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
           (*(uint *)(puVar6 + 8) != uVar1 >> 0xc)) {
          iVar5 = 0;
        }
        else {
          iVar5 = *(int *)(puVar6 + 4);
        }
        if (iVar4 != iVar5) {
          if (local_30[0x6c] == (CCSPlayer)0x0) {
            pCVar2 = *(CBaseEdict **)(local_30 + 0x30);
            if (pCVar2 != (CBaseEdict *)0x0) {
              *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
              iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
              *(undefined2 *)(iVar4 + 2) = 0;
            }
          }
          else {
            local_30[0x70] = (CCSPlayer)((byte)local_30[0x70] | 1);
          }
          *(uint *)(local_30 + 0x2b40) = local_20[0];
        }
        CHandle<CBaseEntity>::CHandle((CHandle<CBaseEntity> *)local_20,(CBaseEntity *)param_3);
        if (((local_20[0] == 0xffffffff) ||
            (puVar6 = g_pEntityList + (local_20[0] & 0xfff) * 0x10,
            puVar6 == (undefined *)0xfffffffc)) || (*(uint *)(puVar6 + 8) != local_20[0] >> 0xc)) {
          iVar4 = 0;
        }
        else {
          iVar4 = *(int *)(puVar6 + 4);
        }
        uVar1 = *(uint *)(local_30 + 0x2b3c);
        if (((uVar1 == 0xffffffff) ||
            (puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
           (*(uint *)(puVar6 + 8) != uVar1 >> 0xc)) {
          iVar5 = 0;
        }
        else {
          iVar5 = *(int *)(puVar6 + 4);
        }
        if (iVar4 != iVar5) {
          if (local_30[0x6c] == (CCSPlayer)0x0) {
            pCVar2 = *(CBaseEdict **)(local_30 + 0x30);
            if (pCVar2 != (CBaseEdict *)0x0) {
              *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
              iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
              *(undefined2 *)(iVar4 + 2) = 0;
            }
          }
          else {
            local_30[0x70] = (CCSPlayer)((byte)local_30[0x70] | 1);
          }
          *(uint *)(local_30 + 0x2b3c) = local_20[0];
        }
        if (param_2 != *(int *)(local_30 + 0x2b44)) {
          if (local_30[0x6c] == (CCSPlayer)0x0) {
            pCVar2 = *(CBaseEdict **)(local_30 + 0x30);
            if (pCVar2 != (CBaseEdict *)0x0) {
              *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
              iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
              *(undefined2 *)(iVar4 + 2) = 0;
            }
          }
          else {
            local_30[0x70] = (CCSPlayer)((byte)local_30[0x70] | 1);
          }
          *(int *)(local_30 + 0x2b44) = param_2;
        }
      }
    }
    return;
  }
  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)