L L4D2node

CBaseButton::TriggerAndWait

0x00635000 · 467 bytes · __thiscall

_ZN11CBaseButton14TriggerAndWaitEv

Decompiled

undefined (1 param)

/* CBaseButton::TriggerAndWait() */

void __thiscall CBaseButton::TriggerAndWait(CBaseButton *this)

{
  CBaseEdict *this_00;
  char cVar1;
  int iVar2;
  uint uVar3;
  CBaseButton CVar4;
  undefined4 uVar5;
  CBaseEntity *pCVar6;
  undefined *puVar7;
  undefined1 local_14 [8];
  
  uVar5 = 0;
  uVar3 = *(uint *)(this + 0x494);
  if (((uVar3 != 0xffffffff) &&
      (puVar7 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar7 + 8) == uVar3 >> 0xc)) {
    uVar5 = *(undefined4 *)(puVar7 + 4);
  }
  cVar1 = UTIL_IsMasterTriggered(*(undefined4 *)(this + 0x4b4),uVar5);
  if ((cVar1 != '\0') && (this[0x4f4] == (CBaseButton)0x0)) {
    *(undefined4 *)(this + 0x440) = 0;
    uVar3 = *(uint *)(this + 0x148);
    CVar4 = (CBaseButton)((byte)(uVar3 >> 5) & 1);
    if (CVar4 != this[0x58c]) {
      if (this[0x6c] == (CBaseButton)0x0) {
        this_00 = *(CBaseEdict **)(this + 0x30);
        if (this_00 != (CBaseEdict *)0x0) {
          *(uint *)this_00 = *(uint *)this_00 | 0x101;
          iVar2 = CBaseEdict::GetChangeAccessor(this_00);
          *(undefined2 *)(iVar2 + 2) = 0;
          uVar3 = *(uint *)(this + 0x148);
        }
      }
      else {
        this[0x70] = (CBaseButton)((byte)this[0x70] | 1);
      }
      this[0x58c] = CVar4;
    }
    if ((this[0x4c4] == (CBaseButton)0x0) && ((uVar3 & 0x20) == 0)) {
      CBaseEntity::SetNextThink
                ((CBaseEntity *)this,*(float *)(this + 0x448) + *(float *)(gpGlobals + 0xc),
                 (char *)0x0);
      CBaseEntity::ThinkSet((_func_void *)local_14,(float)this,(char *)ButtonReturn);
    }
    else if ((uVar3 & 0x100) == 0) {
      *(undefined4 *)(this + 0xd8) = 0;
      *(undefined4 *)(this + 0xdc) = 0;
    }
    else {
      *(code **)(this + 0xd8) = ButtonTouch;
      *(undefined4 *)(this + 0xdc) = 0;
    }
    uVar3 = *(uint *)(this + 0x494);
    pCVar6 = (CBaseEntity *)0x0;
    *(undefined4 *)(this + 0x580) = 1;
    if (((uVar3 != 0xffffffff) &&
        (puVar7 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar7 + 8) == uVar3 >> 0xc)) {
      pCVar6 = *(CBaseEntity **)(puVar7 + 4);
    }
    COutputEvent::FireOutput((COutputEvent *)(this + 0x550),pCVar6,(CBaseEntity *)this,0.0);
    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)