L L4D2node

CCaptionRepeatMgr::CanEmitCaption

0x004b3c00 · 177 bytes · __thiscall

_ZN17CCaptionRepeatMgr14CanEmitCaptionEj

Decompiled

undefined (2 params)

/* CCaptionRepeatMgr::CanEmitCaption(unsigned int) */

undefined4 __thiscall CCaptionRepeatMgr::CanEmitCaption(CCaptionRepeatMgr *this,uint param_1)

{
  float fVar1;
  ushort uVar2;
  int iVar3;
  float fVar4;
  uint local_24;
  float local_20;
  
  if (gpGlobals[5] != 1.4013e-45) {
    fVar1 = *gpGlobals;
    RemoveCaptionsBefore(this,fVar1 - *(float *)(cc_norepeat._28_4_ + 0x2c));
    local_24 = param_1;
    uVar2 = CUtlRBTree<CUtlMap<unsigned_int,float,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,float,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,float,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
            ::Find((CUtlRBTree<CUtlMap<unsigned_int,float,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,float,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,float,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                    *)this,(Node_t *)&local_24);
    if (uVar2 == 0xffff) {
      local_24 = param_1;
      local_20 = fVar1;
      CUtlRBTree<CUtlMap<unsigned_int,float,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,float,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,float,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
      ::Insert((CUtlRBTree<CUtlMap<unsigned_int,float,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,float,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,float,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                *)this,(Node_t *)&local_24);
    }
    else {
      iVar3 = (uint)uVar2 * 0x10 + *(int *)(this + 4);
      fVar4 = fVar1 - *(float *)(iVar3 + 0xc);
      if (fVar4 < *(float *)(cc_norepeat._28_4_ + 0x2c) ||
          fVar4 == *(float *)(cc_norepeat._28_4_ + 0x2c)) {
        return 0;
      }
      *(float *)(iVar3 + 0xc) = fVar1;
    }
  }
  return 1;
}

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)