L L4D2node

CreateGameRulesObject

0x004612b0 · 195 bytes · __cdecl

_Z21CreateGameRulesObjectPKc

Decompiled

undefined (1 param)

/* CreateGameRulesObject(char const*) */

void CreateGameRulesObject(char *param_1)

{
  int *piVar1;
  int iVar2;
  size_t sVar3;
  
  if (g_pGameRules != (int *)0x0) {
    (**(code **)(*g_pGameRules + 0x34))(g_pGameRules);
  }
  g_pGameRules = (int *)0x0;
  iVar2 = CGameRulesRegister::FindByName(param_1);
  if (iVar2 == 0) {
    Error("InitGameRules: missing gamerules class \'%s\' on the server",param_1);
  }
  (**(code **)(iVar2 + 4))();
  if (g_pGameRules == (int *)0x0) {
    Error("InitGameRules: game rules entity (%s) not created",param_1);
  }
  piVar1 = g_StringTableGameRules;
  sVar3 = strlen(param_1);
  (**(code **)(*piVar1 + 0x24))(piVar1,1,"classname",sVar3 + 1,param_1);
  if (g_pGameRules != (int *)0x0) {
                    /* WARNING: Could not recover jumptable at 0x0046133d. Too many branches */
                    /* WARNING: Treating indirect jump as call */
    (**(code **)(*g_pGameRules + 0x1fc))();
    return;
  }
  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)