L L4D2node

CBaseButton::ButtonActivate

0x00639880 · 635 bytes · __thiscall

_ZN11CBaseButton14ButtonActivateEv

Decompiled

undefined (1 param)

/* CBaseButton::ButtonActivate() */

void __thiscall CBaseButton::ButtonActivate(CBaseButton *this)

{
  uint uVar1;
  char cVar2;
  int iVar3;
  undefined4 uVar4;
  undefined *puVar5;
  undefined4 *puVar6;
  undefined **local_80 [8];
  undefined4 local_60;
  undefined1 *local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined1 local_3c;
  undefined1 local_3b;
  undefined1 local_3a;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined2 local_20;
  
  puVar6 = (undefined4 *)&stack0xffffff64;
  if (*(int *)(this + 0x504) != 0) {
    (**(code **)(*(int *)this + 0x28c))();
    CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_80);
    local_80[0] = &PTR__CPASFilter_00bfaf28;
                    /* try { // try from 006398cb to 006398cf has its CatchHandler @ 00639b3f */
    CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)local_80,(Vector *)&local_60);
    local_80[0] = &PTR__CPASAttenuationFilter_00c08ec8;
                    /* try { // try from 006398e0 to 006398fc has its CatchHandler @ 00639b3b */
    (**(code **)(*(int *)this + 0x28c))();
    puVar6 = (undefined4 *)&stack0xffffff5c;
    CPASAttenuationFilter::Filter((CPASAttenuationFilter *)local_80,(Vector *)&local_60,0.8);
    local_3c = 1;
    local_20 = 0xffff;
    local_58 = 0x3f800000;
    local_50 = 0;
    local_4c = 100;
    local_5c = &DAT_00d539c2;
    if (*(undefined1 **)(this + 0x504) != (undefined1 *)0x0) {
      local_5c = *(undefined1 **)(this + 0x504);
    }
    local_48 = 0;
    local_44 = 0;
    local_40 = 0;
    local_3b = 0;
    local_3a = 0;
    local_38 = 0xffffffff;
    local_34 = 0;
    local_30 = 0;
    local_2c = 0;
    local_28 = 0;
    local_24 = 0;
    local_60 = 2;
    local_54 = 0x4b;
    if (*(int *)(this + 0x30) == 0) {
      iVar3 = 0;
    }
    else {
      iVar3 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
    }
                    /* try { // try from 006399a9 to 006399ad has its CatchHandler @ 00639b17 */
    CBaseEntity::EmitSound((IRecipientFilter *)local_80,iVar3,(EmitSound_t *)&local_60);
    local_28 = 0;
    CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)&local_34);
    local_24 = local_34;
    CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)&local_34);
    local_80[0] = &PTR__CPASFilter_00bfaf28;
    CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_80);
  }
  uVar1 = *(uint *)(this + 0x494);
  uVar4 = 0;
  if (((uVar1 != 0xffffffff) &&
      (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) {
    uVar4 = *(undefined4 *)(puVar5 + 4);
  }
  puVar6[1] = uVar4;
  *puVar6 = *(undefined4 *)(this + 0x4b4);
  puVar6[-1] = 0x639a22;
  cVar2 = UTIL_IsMasterTriggered();
  if ((cVar2 != '\0') && (this[0x4f4] == (CBaseButton)0x0)) {
    puVar6[3] = 1;
    puVar6[2] = 0;
    puVar6[1] = this + 0x4c8;
    *puVar6 = this;
    puVar6[-1] = 0x639a82;
    PlayLockSounds((CBaseEntity *)*puVar6,(locksound_t *)puVar6[1],puVar6[2],puVar6[3]);
    *(undefined4 *)(this + 0x440) = 2;
    *(code **)(this + 0x14) = TriggerAndWait;
    *(undefined4 *)(this + 0x18) = 0;
    if (this[0x4c5] != (CBaseButton)0x0) {
      uVar4 = *(undefined4 *)(this + 0x11c);
      *puVar6 = this;
      puVar6[1] = this + 0x484;
      puVar6[2] = uVar4;
      puVar6[-1] = 0x639ac3;
      CBaseToggle::AngularMove((CBaseToggle *)*puVar6,(QAngle *)puVar6[1],(float)puVar6[2]);
      return;
    }
    uVar4 = *(undefined4 *)(this + 0x11c);
    *puVar6 = this;
    puVar6[1] = this + 0x460;
    puVar6[2] = uVar4;
    puVar6[-1] = 0x639af0;
    CBaseToggle::LinearMove((CBaseToggle *)*puVar6,(Vector *)puVar6[1],(float)puVar6[2]);
    return;
  }
  *puVar6 = this;
  puVar6[3] = 1;
  puVar6[2] = 1;
  puVar6[1] = this + 0x4c8;
  puVar6[-1] = 0x639a51;
  PlayLockSounds((CBaseEntity *)*puVar6,(locksound_t *)puVar6[1],puVar6[2],puVar6[3]);
  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)