L L4D2node

CTeamplayRoundBasedRules::CheckWinLimit

0x004c8e40 · 192 bytes · __thiscall

_ZN24CTeamplayRoundBasedRules13CheckWinLimitEv

Decompiled

undefined (1 param)

/* CTeamplayRoundBasedRules::CheckWinLimit() */

undefined4 __thiscall CTeamplayRoundBasedRules::CheckWinLimit(CTeamplayRoundBasedRules *this)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  
  iVar4 = 2;
  iVar1 = *(int *)(mp_winlimit._28_4_ + 0x30);
  if (0 < iVar1) {
    for (; iVar3 = GetNumberOfTeams(), iVar4 < iVar3; iVar4 = iVar4 + 1) {
      piVar2 = (int *)GetGlobalTeam(iVar4);
      iVar3 = (**(code **)(*piVar2 + 0x364))(piVar2);
      if (iVar1 <= iVar3) {
        piVar2 = (int *)(**(code **)(*gameeventmanager + 0x1c))
                                  (gameeventmanager,"teamplay_game_over",0,0);
        if (piVar2 != (int *)0x0) {
          (**(code **)(*piVar2 + 0x3c))(piVar2,"reason","Reached Win Limit");
          (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar2,0);
        }
        (**(code **)(*(int *)this + 0x248))(this);
        return 1;
      }
    }
  }
  return 0;
}

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)