L L4D2node

CTeamplayRoundBasedRules::ResetMapTime

0x004cbee0 · 206 bytes · __thiscall

_ZN24CTeamplayRoundBasedRules12ResetMapTimeEv

Decompiled

undefined (1 param)

/* CTeamplayRoundBasedRules::ResetMapTime() */

void __thiscall CTeamplayRoundBasedRules::ResetMapTime(CTeamplayRoundBasedRules *this)

{
  float fVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  
  fVar1 = *(float *)(gpGlobals + 0xc);
  if (fVar1 != *(float *)(this + 0x330)) {
    CGameRulesProxy::NotifyNetworkStateChanged();
    *(float *)(this + 0x330) = fVar1;
  }
  piVar2 = (int *)(**(code **)(*gameeventmanager + 0x1c))
                            (gameeventmanager,"teamplay_map_time_remaining",0,0);
  if (piVar2 != (int *)0x0) {
    iVar4 = (int)(((float)(*(int *)(mp_timelimit._28_4_ + 0x30) * 0x3c) -
                  *(float *)(gpGlobals + 0xc)) + *(float *)(this + 0x330));
    iVar3 = 0;
    if (-1 < iVar4) {
      iVar3 = iVar4;
    }
    (**(code **)(*piVar2 + 0x30))(piVar2,"seconds",iVar3);
    (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar2,0);
  }
  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)