L L4D2node

CCSGameRules::SelectDefaultTeam

0x00437be0 · 275 bytes · __thiscall

_ZN12CCSGameRules17SelectDefaultTeamEb

Decompiled

undefined (2 params)

/* CCSGameRules::SelectDefaultTeam(bool) */

undefined4 __thiscall CCSGameRules::SelectDefaultTeam(CCSGameRules *this,bool param_1)

{
  char cVar1;
  undefined4 uVar2;
  int iVar3;
  int iVar4;
  undefined4 uVar5;
  
  iVar4 = *(int *)(this + 0x26c);
  iVar3 = *(int *)(this + 0x270);
  if (param_1) {
    iVar4 = UTIL_HumansOnTeam(2,false);
    iVar3 = UTIL_HumansOnTeam(3,false);
  }
  if (iVar4 < iVar3) {
LAB_00437c48:
    cVar1 = (**(code **)(*(int *)this + 0x2a8))(this,2);
    if (cVar1 == '\0') {
      return 2;
    }
    uVar5 = 3;
  }
  else {
    if (iVar4 <= iVar3) {
      if ((*(short *)(this + 0x28a) < *(short *)(this + 0x288)) ||
         ((*(short *)(this + 0x28a) <= *(short *)(this + 0x288) &&
          (iVar4 = (**(code **)(*random_valve + 8))(random_valve,0,1), iVar4 != 0))))
      goto LAB_00437c48;
    }
    cVar1 = (**(code **)(*(int *)this + 0x2a8))(this,3);
    if (cVar1 == '\0') {
      return 3;
    }
    uVar5 = 2;
  }
  cVar1 = (**(code **)(*(int *)this + 0x2a8))(this,uVar5);
  uVar2 = 0;
  if (cVar1 == '\0') {
    uVar2 = uVar5;
  }
  return uVar2;
}

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)