L L4D2node

CTerrorGameRules::CheckAchievementsEnabled

0x00503f60 · 152 bytes · __thiscall

_ZN16CTerrorGameRules24CheckAchievementsEnabledEi

Decompiled

undefined (2 params)

/* CTerrorGameRules::CheckAchievementsEnabled(int) */

CTerrorGameRules __thiscall
CTerrorGameRules::CheckAchievementsEnabled(CTerrorGameRules *this,int param_1)

{
  KeyValues *this_00;
  char *pcVar1;
  int iVar2;
  CTerrorGameRules CVar3;
  
  CVar3 = this[0x494];
  if (CVar3 != (CTerrorGameRules)0x0) {
    if ((param_1 != 0x3c) && (1 < param_1 - 0x42U)) {
      pcVar1 = "FCVAR_NEVER_AS_STRING";
      if ((mp_gamemode[0x15] & 0x10) == 0) {
        pcVar1 = "";
        if (*(char **)(mp_gamemode._28_4_ + 0x24) != (char *)0x0) {
          pcVar1 = *(char **)(mp_gamemode._28_4_ + 0x24);
        }
      }
      this_00 = (KeyValues *)(**(code **)(*g_pMatchExtL4D + 0x10))(g_pMatchExtL4D,pcVar1);
      if (this_00 != (KeyValues *)0x0) {
        pcVar1 = (char *)KeyValues::GetName(this_00);
        iVar2 = _V_stricmp(pcVar1,"ultrarealism");
        if (iVar2 == 0) {
          CVar3 = (CTerrorGameRules)0x0;
        }
      }
    }
    return CVar3;
  }
  return (CTerrorGameRules)0x1;
}

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)