L L4D2node

CMatchExtL4D::GetRandomMission

0x00036000 · 149 bytes · __cdecl

_ZN12CMatchExtL4D16GetRandomMissionEP9KeyValuesy

Decompiled

undefined (2 params)

/* CMatchExtL4D::GetRandomMission(KeyValues*, unsigned long long) */

undefined4 CMatchExtL4D::GetRandomMission(KeyValues *param_1,ulonglong param_2)

{
  int iVar1;
  undefined4 uVar2;
  undefined4 in_stack_00000010;
  int local_20 [5];
  
  local_20[0] = 0;
  local_20[1] = 0;
  local_20[2] = 0;
  local_20[3] = 0;
  local_20[4] = 0;
                    /* try { // try from 00036046 to 00036064 has its CatchHandler @ 0003609c */
  FindMissionsForDlcMask
            (CONCAT44(in_stack_00000010,param_2._4_4_),(KeyValues *)param_2,(CUtlVector *)local_20);
  if (local_20[3] == 0) {
    uVar2 = 0;
  }
  else {
    iVar1 = RandomInt(0,local_20[3] + -1);
    uVar2 = *(undefined4 *)(local_20[0] + iVar1 * 4);
  }
  local_20[3] = 0;
  CUtlMemory<KeyValues*,int>::Purge((CUtlMemory<KeyValues*,int> *)local_20);
  local_20[4] = local_20[0];
  CUtlMemory<KeyValues*,int>::Purge((CUtlMemory<KeyValues*,int> *)local_20);
  return uVar2;
}

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)