L L4D2node

CScriptConvarAccessor::SetValue

0x00b42930 · 221 bytes · __thiscall

_ZN21CScriptConvarAccessor8SetValueEPKc12CVariantBaseI24CVariantDefaultAllocatorE

Decompiled

undefined (3 params)

/* CScriptConvarAccessor::SetValue(char const*, CVariantBase<CVariantDefaultAllocator>) */

void __thiscall CScriptConvarAccessor::SetValue(undefined4 this,char *param_1,undefined4 *param_3)

{
  ushort uVar1;
  char cVar2;
  char *pcVar3;
  int *local_24 [5];
  
  ConVarRef::ConVarRef((ConVarRef *)local_24,param_1);
  cVar2 = ConVarRef::IsValid((ConVarRef *)local_24);
  if (cVar2 != '\0') {
    uVar1 = *(ushort *)(param_3 + 2);
    if (uVar1 == 5) {
      (**(code **)(*local_24[0] + 8))(local_24[0],*param_3);
    }
    else if ((short)uVar1 < 6) {
      if (uVar1 != 1) {
LAB_00b429f0:
        pcVar3 = "unknown_variant_type";
        if (uVar1 < 0x29) {
          pcVar3 = *(char **)(CSWTCH_2512 + (uint)uVar1 * 4);
        }
        Warning("%s.SetValue() unsupported value type %s\n",param_1,pcVar3);
        return;
      }
      (**(code **)(*local_24[0] + 4))(local_24[0],*param_3);
    }
    else if (uVar1 == 6) {
      (**(code **)(*local_24[0] + 8))(local_24[0],*(undefined1 *)param_3);
    }
    else {
      if (uVar1 != 0x1f) goto LAB_00b429f0;
      (**(code **)*local_24[0])(local_24[0],*param_3);
    }
    CTerrorGameRules::SaveConvar(g_pGameRules,(ConVarRef *)local_24);
  }
  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)