L L4D2node

CBaseButton::OnUseLocked

0x006374c0 · 135 bytes · __thiscall

_ZN11CBaseButton11OnUseLockedEP11CBaseEntity

Decompiled

undefined (2 params)

/* CBaseButton::OnUseLocked(CBaseEntity*) */

bool __thiscall CBaseButton::OnUseLocked(CBaseButton *this,CBaseEntity *param_1)

{
  float fVar1;
  bool bVar2;
  bool bVar3;
  
  PlayLockSounds((CBaseEntity *)this,(locksound_t *)(this + 0x4c8),1,1);
  fVar1 = *(float *)(gpGlobals + 0xc);
  bVar2 = fVar1 != *(float *)(this + 0x4fc);
  bVar3 = *(float *)(this + 0x4fc) <= fVar1;
  if (bVar3 && bVar2) {
    COutputEvent::FireOutput((COutputEvent *)(this + 0x538),param_1,(CBaseEntity *)this,0.0);
    *(float *)(this + 0x4fc) = *(float *)(gpGlobals + 0xc) + 0.5;
  }
  return bVar3 && bVar2;
}

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)