L L4D2node

CMatchExtL4D::GetMapInfo

0x00035030 · 406 bytes · __thiscall

_ZN12CMatchExtL4D10GetMapInfoEP9KeyValuesPS1_

Decompiled

undefined (3 params)

/* CMatchExtL4D::GetMapInfo(KeyValues*, KeyValues**) */

int __thiscall CMatchExtL4D::GetMapInfo(CMatchExtL4D *this,KeyValues *param_1,KeyValues **param_2)

{
  char *pcVar1;
  char *pcVar2;
  int iVar3;
  KeyValues *this_00;
  int iVar4;
  int in_GS_OFFSET;
  CFmtStrN<256> local_12c [5];
  char local_127 [263];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (*(int *)(this + 4) != 0) {
    pcVar1 = (char *)KeyValues::GetString(param_1,"Game/mode",(char *)0x0);
    if ((pcVar1 != (char *)0x0) && (*pcVar1 != '\0')) {
      pcVar2 = (char *)KeyValues::GetString(param_1,"Game/campaign",(char *)0x0);
      if ((pcVar2 != (char *)0x0) && (*pcVar2 != '\0')) {
        iVar3 = KeyValues::GetInt(param_1,"Game/chapter",0);
        if (0 < iVar3) {
          CFmtStrN<256>::CFmtStrN(local_12c,"GameModes/%s/missions/%s",pcVar1,pcVar2);
          this_00 = (KeyValues *)KeyValues::GetPtr(*(KeyValues **)(this + 4),local_127,(void *)0x0);
          if (this_00 != (KeyValues *)0x0) {
            CFmtStrN<256>::CFmtStrN(local_12c,"Modes/%s/chapters",pcVar1,pcVar2);
            iVar4 = KeyValues::GetInt(this_00,local_127,0);
            if (iVar3 <= iVar4) {
              CFmtStrN<256>::CFmtStrN(local_12c,"Modes/%s/%d",pcVar1,iVar3);
              iVar3 = KeyValues::FindKey(this_00,local_127,false);
              if (iVar3 != 0) {
                if (param_2 != (KeyValues **)0x0) {
                  *param_2 = this_00;
                }
                goto LAB_000351b2;
              }
            }
          }
        }
      }
    }
  }
  iVar3 = 0;
LAB_000351b2:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return iVar3;
  }
                    /* 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)