L L4D2node

CCSGameRules::CheckRestartRound

0x00433e30 · 577 bytes · __thiscall

_ZN12CCSGameRules17CheckRestartRoundEv

Decompiled

undefined (1 param)

/* CCSGameRules::CheckRestartRound() */

void __thiscall CCSGameRules::CheckRestartRound(CCSGameRules *this)

{
  float fVar1;
  char *pcVar2;
  int iVar3;
  int in_GS_OFFSET;
  float fVar4;
  char local_60 [64];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar3 = *(int *)(mp_restartgame._28_4_ + 0x30);
  if (iVar3 < 1) goto LAB_00433f90;
  if (iVar3 < 0x3d) {
    fVar4 = (float)iVar3;
    if (iVar3 != 1) goto LAB_00433fc1;
    UTIL_LogPrintf("World triggered \"Restart_Round_(%i_%s)\"\n",1,"second");
    UTIL_LogPrintf("Team \"CT\" scored \"%i\" with \"%i\" players\n",(int)*(short *)(this + 0x288),
                   *(undefined4 *)(this + 0x270));
    UTIL_LogPrintf("Team \"TERRORIST\" scored \"%i\" with \"%i\" players\n",
                   (int)*(short *)(this + 0x28a),*(undefined4 *)(this + 0x26c));
    V_snprintf(local_60,0x40,"%d",1);
    UTIL_ClientPrintAll(4,"#Game_will_restart_in",local_60,"SECOND",(char *)0x0,(char *)0x0);
    pcVar2 = "SECOND";
    fVar4 = 1.0;
  }
  else {
    iVar3 = 0x3c;
    fVar4 = 60.0;
LAB_00433fc1:
    UTIL_LogPrintf("World triggered \"Restart_Round_(%i_%s)\"\n",iVar3,"seconds");
    UTIL_LogPrintf("Team \"CT\" scored \"%i\" with \"%i\" players\n",(int)*(short *)(this + 0x288),
                   *(undefined4 *)(this + 0x270));
    UTIL_LogPrintf("Team \"TERRORIST\" scored \"%i\" with \"%i\" players\n",
                   (int)*(short *)(this + 0x28a),*(undefined4 *)(this + 0x26c));
    V_snprintf(local_60,0x40,"%d",iVar3);
    UTIL_ClientPrintAll(4,"#Game_will_restart_in",local_60,"SECONDS",(char *)0x0,(char *)0x0);
    pcVar2 = "SECONDS";
  }
  UTIL_ClientPrintAll(2,"#Game_will_restart_in",local_60,pcVar2,(char *)0x0,(char *)0x0);
  fVar1 = *(float *)(gpGlobals + 0xc);
  this[0x27d] = (CCSGameRules)0x1;
  *(float *)(this + 0x268) = fVar4 + fVar1;
  ConVar::SetValue(0xf7df20);
LAB_00433f90:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)