L L4D2node

CTerrorPlayer::OnCarryEnded

0x009afde0 · 895 bytes · __thiscall

_ZN13CTerrorPlayer12OnCarryEndedEbbb

Decompiled

undefined (4 params)

/* CTerrorPlayer::OnCarryEnded(bool, bool, bool) */

void __thiscall
CTerrorPlayer::OnCarryEnded(CTerrorPlayer *this,bool param_1,bool param_2,bool param_3)

{
  uint uVar1;
  code *pcVar2;
  CBaseEdict *pCVar3;
  int *piVar4;
  undefined4 uVar5;
  int iVar6;
  CTerrorPlayer *pCVar7;
  undefined *puVar8;
  
  uVar1 = *(uint *)(this + 0x2a48);
  if ((((uVar1 == 0xffffffff) ||
       (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar8 + 8) != uVar1 >> 0xc)) ||
     (*(CTerrorPlayer **)(puVar8 + 4) == (CTerrorPlayer *)0x0)) {
    uVar1 = *(uint *)(this + 0x2a4c);
    if (((uVar1 != 0xffffffff) &&
        (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
       ((*(uint *)(puVar8 + 8) == uVar1 >> 0xc && ((*(int *)(puVar8 + 4) != 0 && (!param_3)))))) {
      this[0x3f04] = (CTerrorPlayer)0x0;
      (**(code **)(*(int *)this + 0x98))(this,0,0xffffffff);
      if (param_1) {
        pCVar7 = (CTerrorPlayer *)0x0;
        uVar1 = *(uint *)(this + 0x2a4c);
        if (((uVar1 != 0xffffffff) &&
            (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
           (*(uint *)(puVar8 + 8) == uVar1 >> 0xc)) {
          pCVar7 = *(CTerrorPlayer **)(puVar8 + 4);
        }
        OnCarryEnded(pCVar7,false,param_2,false);
      }
      uVar1 = *(uint *)(this + 0x2a4c);
      if (((uVar1 != 0xffffffff) &&
          (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
         ((*(uint *)(puVar8 + 8) == uVar1 >> 0xc && (*(int *)(puVar8 + 4) != 0)))) {
        if (this[0x6c] == (CTerrorPlayer)0x0) {
          pCVar3 = *(CBaseEdict **)(this + 0x30);
          if (pCVar3 != (CBaseEdict *)0x0) {
            *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
            iVar6 = CBaseEdict::GetChangeAccessor(pCVar3);
            *(undefined2 *)(iVar6 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
        }
        *(undefined4 *)(this + 0x2a4c) = 0xffffffff;
      }
    }
  }
  else {
    if (!param_2) {
      QueuePummelVictim(this,*(CTerrorPlayer **)(puVar8 + 4),-1.0);
    }
    if (param_1) {
      pCVar7 = (CTerrorPlayer *)0x0;
      uVar1 = *(uint *)(this + 0x2a48);
      if (((uVar1 != 0xffffffff) &&
          (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar8 + 8) == uVar1 >> 0xc)) {
        pCVar7 = *(CTerrorPlayer **)(puVar8 + 4);
      }
      OnCarryEnded(pCVar7,false,param_2,param_3);
    }
    piVar4 = (int *)(**(code **)(*gameeventmanager + 0x1c))
                              (gameeventmanager,"charger_carry_end",0,0);
    if (piVar4 != (int *)0x0) {
      pcVar2 = *(code **)(*piVar4 + 0x30);
      uVar5 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this + 0x30));
      (*pcVar2)(piVar4,"userid",uVar5);
      uVar1 = *(uint *)(this + 0x2a48);
      if (((uVar1 != 0xffffffff) &&
          (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
         ((*(uint *)(puVar8 + 8) == uVar1 >> 0xc && (*(int *)(puVar8 + 4) != 0)))) {
        pcVar2 = *(code **)(*piVar4 + 0x30);
        uVar5 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(*(int *)(puVar8 + 4) + 0x30));
        (*pcVar2)(piVar4,"victim",uVar5);
      }
      (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar4,0);
    }
    uVar1 = *(uint *)(this + 0x2a48);
    if ((((uVar1 != 0xffffffff) &&
         (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
        (*(uint *)(puVar8 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar8 + 4) != 0)) {
      if (this[0x6c] == (CTerrorPlayer)0x0) {
        pCVar3 = *(CBaseEdict **)(this + 0x30);
        if (pCVar3 != (CBaseEdict *)0x0) {
          *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
          iVar6 = CBaseEdict::GetChangeAccessor(pCVar3);
          *(undefined2 *)(iVar6 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
      }
      *(undefined4 *)(this + 0x2a48) = 0xffffffff;
      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)