L L4D2node

CLogicCase::InputPickRandom

0x006ea950 · 179 bytes · __thiscall

_ZN10CLogicCase15InputPickRandomER11inputdata_t

Decompiled

undefined (2 params)

/* CLogicCase::InputPickRandom(inputdata_t&) */

void __thiscall CLogicCase::InputPickRandom(CLogicCase *this,inputdata_t *param_1)

{
  int iVar1;
  undefined4 uVar2;
  int in_GS_OFFSET;
  byte local_20 [16];
  int local_10;
  
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  iVar1 = BuildCaseMap(this,local_20);
  if (iVar1 < 1) {
    uVar2 = CBaseEntity::GetDebugName((CBaseEntity *)this);
    DevMsg(1,"Firing PickRandom input on logic_case %s with no cases set up\n",uVar2);
  }
  else {
    iVar1 = (**(code **)(*random_valve + 8))(random_valve,0,iVar1 + -1);
    if (local_20[iVar1] < 0x10) {
      COutputEvent::FireOutput
                ((COutputEvent *)(this + (uint)local_20[iVar1] * 0x18 + 0x498),
                 *(CBaseEntity **)param_1,(CBaseEntity *)this,0.0);
    }
  }
  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)