L L4D2node

CSelfDestruct::ActivateAbility

0x004db1f0 · 539 bytes · __thiscall

_ZN13CSelfDestruct15ActivateAbilityEv

Decompiled

undefined (1 param)

/* CSelfDestruct::ActivateAbility() */

void __thiscall CSelfDestruct::ActivateAbility(CSelfDestruct *this)

{
  CBaseEdict *this_00;
  uint uVar1;
  code *pcVar2;
  int iVar3;
  int *piVar4;
  undefined4 uVar5;
  undefined1 *puVar6;
  CBaseEntity *this_01;
  undefined *puVar7;
  longdouble lVar8;
  
  if (this[0x45d] != (CSelfDestruct)0x1) {
    if (this[0x6c] == (CSelfDestruct)0x0) {
      this_00 = *(CBaseEdict **)(this + 0x30);
      if (this_00 != (CBaseEdict *)0x0) {
        *(uint *)this_00 = *(uint *)this_00 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(this_00);
        *(undefined2 *)(iVar3 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CSelfDestruct)((byte)this[0x70] | 1);
    }
    this[0x45d] = (CSelfDestruct)0x1;
  }
  lVar8 = (longdouble)CountdownTimer::Now();
  if ((float)lVar8 + 2.0 != *(float *)(this + 0x468)) {
    (**(code **)(*(int *)(this + 0x460) + 4))(this + 0x460,this + 0x468);
    *(float *)(this + 0x468) = (float)lVar8 + 2.0;
  }
  if (*(float *)(this + 0x464) != 2.0) {
    (**(code **)(*(int *)(this + 0x460) + 4))(this + 0x460,this + 0x464);
    *(undefined4 *)(this + 0x464) = 0x40000000;
  }
  uVar1 = *(uint *)(this + 0x44c);
  this_01 = (CBaseEntity *)0x0;
  if (((uVar1 != 0xffffffff) &&
      (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
    this_01 = *(CBaseEntity **)(puVar7 + 4);
  }
  CBaseEntity::AddFlag(this_01,0x20);
  piVar4 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"ability_use",0,0);
  if (piVar4 != (int *)0x0) {
    iVar3 = 0;
    pcVar2 = *(code **)(*piVar4 + 0x30);
    uVar1 = *(uint *)(this + 0x44c);
    if (((uVar1 != 0xffffffff) &&
        (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
      iVar3 = *(int *)(puVar7 + 4);
    }
    uVar5 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(iVar3 + 0x30));
    (*pcVar2)(piVar4,"userid",uVar5);
    puVar6 = &DAT_00d539c2;
    if (*(undefined1 **)(this + 0x7c) != (undefined1 *)0x0) {
      puVar6 = *(undefined1 **)(this + 0x7c);
    }
    (**(code **)(*piVar4 + 0x3c))(piVar4,"ability",puVar6);
    (**(code **)(*piVar4 + 0x30))(piVar4,"context",0);
    (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar4,0);
  }
  CBaseAbility::ActivateAbility((CBaseAbility *)this);
  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)