L L4D2node

CCharge::ActivateAbility

0x004d6110 · 501 bytes · __thiscall

_ZN7CCharge15ActivateAbilityEv

Decompiled

undefined (1 param)

/* CCharge::ActivateAbility() */

void __thiscall CCharge::ActivateAbility(CCharge *this)

{
  float fVar1;
  uint uVar2;
  code *pcVar3;
  CBaseEdict *this_00;
  char cVar4;
  int iVar5;
  int *piVar6;
  undefined4 uVar7;
  undefined1 *puVar8;
  undefined *puVar9;
  CBaseEntity *this_01;
  longdouble lVar10;
  
  cVar4 = (**(code **)(*(int *)this + 0x32c))(this);
  if (cVar4 != '\0') {
    uVar2 = *(uint *)(this + 0x44c);
    this_01 = (CBaseEntity *)0x0;
    if (((uVar2 != 0xffffffff) &&
        (puVar9 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar9 + 8) == uVar2 >> 0xc)) {
      this_01 = *(CBaseEntity **)(puVar9 + 4);
    }
    cVar4 = (**(code **)(*(int *)this_01 + 0x6f8))(this_01,0);
    if (((cVar4 == '\0') &&
        (lVar10 = (longdouble)CountdownTimer::Now(), *(float *)(this_01 + 0x32dc) <= (float)lVar10))
       && ((iVar5 = CBaseEntity::GetGroundEntity(this_01), iVar5 != 0 ||
           (this_01[0x186] == (CBaseEntity)0x9)))) {
      CTerrorPlayer::OnChargeStart();
      BeginCharge(this);
      fVar1 = *(float *)(gpGlobals + 0xc);
      if (fVar1 != *(float *)(this + 0x460)) {
        if (this[0x6c] == (CCharge)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] = (CCharge)((byte)this[0x70] | 1);
        }
        *(float *)(this + 0x460) = fVar1;
      }
      CBaseAbility::StartActivationTimer((CBaseAbility *)this,3600.0,0.0);
      piVar6 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"ability_use",0,0);
      if (piVar6 != (int *)0x0) {
        pcVar3 = *(code **)(*piVar6 + 0x30);
        uVar7 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this_01 + 0x30));
        (*pcVar3)(piVar6,"userid",uVar7);
        puVar8 = &DAT_00d539c2;
        if (*(undefined1 **)(this + 0x7c) != (undefined1 *)0x0) {
          puVar8 = *(undefined1 **)(this + 0x7c);
        }
        (**(code **)(*piVar6 + 0x3c))(piVar6,"ability",puVar8);
        (**(code **)(*piVar6 + 0x30))(piVar6,"context",0);
        (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar6,0);
      }
      CBaseAbility::ActivateAbility((CBaseAbility *)this);
      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)