L L4D2node

CCSGameRules::InitializePlayerCounts

0x00437280 · 389 bytes · __thiscall

_ZN12CCSGameRules22InitializePlayerCountsERiS0_S0_S0_

Decompiled

undefined (5 params)

/* CCSGameRules::InitializePlayerCounts(int&, int&, int&, int&) */

void __thiscall
CCSGameRules::InitializePlayerCounts
          (CCSGameRules *this,int *param_1,int *param_2,int *param_3,int *param_4)

{
  char cVar1;
  int iVar2;
  int *piVar3;
  int iVar4;
  int *piVar5;
  int local_20;
  
  local_20 = 0;
  *param_3 = 0;
  *param_4 = 0;
  *param_2 = 0;
  *param_1 = 0;
  *(undefined4 *)(this + 0x278) = 0;
  *(undefined4 *)(this + 0x274) = 0;
  *(undefined4 *)(this + 0x270) = 0;
  *(undefined4 *)(this + 0x26c) = 0;
  *(undefined4 *)(this + 0x2b4) = 0;
  iVar2 = GetNumberOfTeams();
  if (0 < iVar2) {
    do {
      piVar3 = (int *)GetGlobalTeam(local_20);
      for (iVar2 = 0; iVar4 = (**(code **)(*piVar3 + 0x354))(piVar3), iVar2 < iVar4;
          iVar2 = iVar2 + 1) {
        piVar5 = (int *)(**(code **)(*piVar3 + 0x358))(piVar3,iVar2);
        if ((piVar5 != (int *)0x0) &&
           (cVar1 = (**(code **)(*piVar5 + 0x16c))(piVar5), cVar1 != '\0')) {
          iVar4 = (**(code **)(*piVar3 + 0x328))(piVar3);
          if (iVar4 == 2) {
            *(int *)(this + 0x26c) = *(int *)(this + 0x26c) + 1;
            if (piVar5[0x8ef] != 3) {
              *(int *)(this + 0x274) = *(int *)(this + 0x274) + 1;
            }
            if ((char)piVar5[0x41] == '\0') {
              *param_1 = *param_1 + 1;
            }
            else {
              *param_3 = *param_3 + 1;
            }
            if (*(char *)((int)piVar5 + 0x23e2) != '\0') {
              *(int *)(this + 0x2b4) = *(int *)(this + 0x2b4) + 1;
            }
          }
          else if (iVar4 == 3) {
            *(int *)(this + 0x270) = *(int *)(this + 0x270) + 1;
            if (piVar5[0x8ef] != 3) {
              *(int *)(this + 0x278) = *(int *)(this + 0x278) + 1;
            }
            if ((char)piVar5[0x41] == '\0') {
              *param_2 = *param_2 + 1;
            }
            else {
              *param_4 = *param_4 + 1;
            }
          }
        }
      }
      local_20 = local_20 + 1;
      iVar2 = GetNumberOfTeams();
    } while (local_20 < iVar2);
  }
  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)