L L4D2node

CCSGameRules::CheckFragLimit

0x00433d20 · 252 bytes · __thiscall

_ZN12CCSGameRules14CheckFragLimitEv

Decompiled

undefined (1 param)

/* CCSGameRules::CheckFragLimit() */

undefined4 __thiscall CCSGameRules::CheckFragLimit(CCSGameRules *this)

{
  CBaseEntity *this_00;
  int *piVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  int iVar5;
  char *pcVar6;
  
  if ((0 < *(int *)(fraglimit._28_4_ + 0x30)) && (0 < *(int *)(gpGlobals + 0x14))) {
    iVar5 = 1;
    while( true ) {
      this_00 = (CBaseEntity *)UTIL_PlayerByIndex(iVar5);
      if ((this_00 != (CBaseEntity *)0x0) &&
         (*(int *)(fraglimit._28_4_ + 0x30) <= *(int *)(this_00 + 0x1f5c))) break;
      iVar5 = iVar5 + 1;
      if (*(int *)(gpGlobals + 0x14) < iVar5) {
        return 0;
      }
    }
    pcVar6 = "UNKNOWN";
    iVar5 = CBaseEntity::GetTeam(this_00);
    if (iVar5 != 0) {
      piVar1 = (int *)CBaseEntity::GetTeam(this_00);
      pcVar6 = (char *)(**(code **)(*piVar1 + 0x32c))(piVar1);
    }
    uVar2 = CBasePlayer::GetNetworkIDString((CBasePlayer *)this_00);
    uVar3 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this_00 + 0x30));
    uVar4 = (**(code **)(*(int *)this_00 + 0xb8))(this_00);
    UTIL_LogPrintf("\"%s<%i><%s><%s>\" triggered \"Intermission_Kill_Limit\"\n",uVar4,uVar3,uVar2,
                   pcVar6);
    (**(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)