L L4D2node

callvote

0x00b415d0 · 264 bytes · __cdecl

_ZL8callvoteRK8CCommand

Decompiled

undefined (1 param)

/* callvote(CCommand const&) */

void callvote(CCommand *param_1)

{
  char cVar1;
  int iVar2;
  int iVar3;
  char *pcVar4;
  char *pcVar5;
  int in_GS_OFFSET;
  longdouble lVar6;
  char *pcVar7;
  CVoteController *pCVar8;
  char local_50 [64];
  int local_10;
  
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  pcVar7 = "Potential vote being called\n";
  Msg("Potential vote being called\n");
  if (*(int *)param_1 < 2) {
    CommandListIssues();
  }
  else {
    iVar2 = UTIL_GetCommandClient();
    if (iVar2 != 0) {
      local_50[0] = '\0';
      if (*(int *)param_1 < 2) {
        pcVar5 = local_50;
        pcVar4 = "";
      }
      else {
        pcVar4 = *(char **)(param_1 + 0x40c);
        pcVar5 = local_50;
        if (*(int *)param_1 != 2) {
          pcVar5 = *(char **)(param_1 + 0x410);
        }
      }
      if (*(int *)(iVar2 + 0x30) == 0) {
        iVar3 = 0;
      }
      else {
        iVar3 = *(int *)(iVar2 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
      }
      pcVar7 = (char *)g_voteController;
      cVar1 = CVoteController::TryCreateVote(g_voteController,iVar3,pcVar4,pcVar5);
      if (cVar1 != '\0') {
        pCVar8 = (CVoteController *)(iVar2 + 0x1e18);
        pcVar7 = (char *)pCVar8;
        lVar6 = (longdouble)IntervalTimer::Now();
        if ((float)lVar6 != *(float *)(iVar2 + 0x1e1c)) {
          (**(code **)(*(int *)(iVar2 + 0x1e18) + 4))(pCVar8,iVar2 + 0x1e1c);
          *(float *)(iVar2 + 0x1e1c) = (float)lVar6;
          pcVar7 = (char *)pCVar8;
        }
      }
    }
  }
  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail(pcVar7);
  }
  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)