L L4D2node

incrementvar

0x0017c0b0 · 463 bytes · __cdecl

_ZL12incrementvarRK8CCommand

Decompiled

undefined (1 param)

/* incrementvar(CCommand const&) */

void incrementvar(CCommand *param_1)

{
  int iVar1;
  int *piVar2;
  char *pcVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  float fVar6;
  float fVar7;
  double dVar8;
  double dVar9;
  
  if (*(int *)param_1 != 5) {
    Warning();
    return;
  }
  iVar1 = *(int *)(param_1 + 0x40c);
  if (iVar1 != 0) {
    piVar2 = (int *)(**(code **)(*g_pCVar + 0x30))(g_pCVar,iVar1);
    if (piVar2 == (int *)0x0) {
      ConDMsg("cvar \"%s\" not found\n",iVar1);
    }
    else {
      fVar6 = *(float *)(piVar2[7] + 0x2c);
      pcVar3 = "";
      if (2 < *(int *)param_1) {
        pcVar3 = *(char **)(param_1 + 0x410);
      }
      dVar8 = strtod(pcVar3,(char **)0x0);
      pcVar3 = "";
      fVar7 = (float)dVar8;
      if (3 < *(int *)param_1) {
        pcVar3 = *(char **)(param_1 + 0x414);
      }
      dVar8 = strtod(pcVar3,(char **)0x0);
      pcVar3 = "";
      if (4 < *(int *)param_1) {
        pcVar3 = *(char **)(param_1 + 0x418);
      }
      dVar9 = strtod(pcVar3,(char **)0x0);
      fVar6 = (float)dVar9 + fVar6;
      if (fVar6 <= (float)dVar8) {
        fVar7 = (float)(~-(uint)(fVar6 < fVar7) & (uint)fVar6 |
                       (uint)(float)dVar8 & -(uint)(fVar6 < fVar7));
      }
      uVar4 = va("%s %f",iVar1,(double)fVar7);
      uVar5 = Cbuf_GetCurrentPlayer();
      Cbuf_AddText(uVar5,uVar4,0);
      uVar4 = (**(code **)(*piVar2 + 0x1c))(piVar2);
      ConDMsg("%s = %f\n",uVar4,(double)fVar7);
    }
    return;
  }
  ConDMsg();
  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)