L L4D2node

CTerrorGameRules::IsSingleChapterMode

0x00506980 · 237 bytes · __cdecl

_ZN16CTerrorGameRules19IsSingleChapterModeEv

Decompiled

undefined (0 params)

/* CTerrorGameRules::IsSingleChapterMode() */

bool CTerrorGameRules::IsSingleChapterMode(void)

{
  code *pcVar1;
  KeyValues *this;
  undefined4 uVar2;
  KeyValues *this_00;
  int iVar3;
  char *pcVar4;
  
  if (g_pMatchExtL4D == (int *)0x0) {
    return false;
  }
  pcVar4 = "FCVAR_NEVER_AS_STRING";
  if ((mp_gamemode[0x15] & 0x10) == 0) {
    pcVar4 = "";
    if (*(char **)(mp_gamemode._28_4_ + 0x24) != (char *)0x0) {
      pcVar4 = *(char **)(mp_gamemode._28_4_ + 0x24);
    }
  }
  this = (KeyValues *)(**(code **)(*g_pMatchExtL4D + 0x10))(g_pMatchExtL4D,pcVar4);
  pcVar1 = *(code **)(*g_pMatchExtL4D + 0x10);
  pcVar4 = "FCVAR_NEVER_AS_STRING";
  if ((mp_gamemode[0x15] & 0x10) == 0) {
    pcVar4 = "";
    if (*(char **)(mp_gamemode._28_4_ + 0x24) != (char *)0x0) {
      pcVar4 = *(char **)(mp_gamemode._28_4_ + 0x24);
    }
  }
  uVar2 = KeyValues::GetString(this,"base",pcVar4);
  this_00 = (KeyValues *)(*pcVar1)(g_pMatchExtL4D,uVar2);
  if ((this_00 != (KeyValues *)0x0) && (this != (KeyValues *)0x0)) {
    iVar3 = KeyValues::GetInt(this_00,"singlechapter",0);
    iVar3 = KeyValues::GetInt(this,"singlechapter",(uint)(iVar3 != 0));
    return iVar3 != 0;
  }
  return false;
}

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)