L L4D2node

CLogicCase::InputPickRandomShuffle

0x006eaa20 · 315 bytes · __thiscall

_ZN10CLogicCase22InputPickRandomShuffleER11inputdata_t

Decompiled

undefined (2 params)

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

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

{
  CLogicCase CVar1;
  int iVar2;
  undefined4 uVar3;
  int iVar4;
  uint uVar5;
  
  iVar2 = *(int *)(this + 0x480);
  if (iVar2 == 0) {
    iVar2 = BuildCaseMap(this,(uchar *)(this + 0x488));
    *(int *)(this + 0x480) = iVar2;
    if (1 < iVar2) {
      if (*(uint *)(this + 0x484) != 0xffffffff) {
        iVar4 = 0;
        do {
          CVar1 = this[iVar4 + 0x488];
          if (*(uint *)(this + 0x484) == (uint)(byte)CVar1) {
            this[iVar4 + 0x488] = this[iVar2 + 0x487];
            this[iVar2 + 0x487] = CVar1;
            iVar2 = iVar2 + -1;
            break;
          }
          iVar4 = iVar4 + 1;
        } while (iVar4 != iVar2);
      }
      goto LAB_006eaa42;
    }
  }
  if (iVar2 < 1) {
    uVar3 = CBaseEntity::GetDebugName((CBaseEntity *)this);
    DevMsg(1,"Firing PickRandom input on logic_case %s with no cases set up\n",uVar3);
    return;
  }
LAB_006eaa42:
  iVar2 = (**(code **)(*random_valve + 8))(random_valve,0,iVar2 + -1);
  uVar5 = (uint)(byte)this[iVar2 + 0x488];
  if (uVar5 < 0x10) {
    COutputEvent::FireOutput
              ((COutputEvent *)(this + uVar5 * 0x18 + 0x498),*(CBaseEntity **)param_1,
               (CBaseEntity *)this,0.0);
  }
  iVar4 = *(int *)(this + 0x480);
  this[iVar2 + 0x488] = this[iVar4 + 0x487];
  *(int *)(this + 0x480) = iVar4 + -1;
  *(uint *)(this + 0x484) = uVar5;
  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)