L L4D2node

CHLTVDirector::StartNewShot

0x006dc140 · 576 bytes · __thiscall

_ZN13CHLTVDirector12StartNewShotEv

Decompiled

undefined (1 param)

/* CHLTVDirector::StartNewShot() */

void __thiscall CHLTVDirector::StartNewShot(CHLTVDirector *this)

{
  char cVar1;
  ushort uVar2;
  int iVar3;
  code *UNRECOVERED_JUMPTABLE;
  uint uVar4;
  char *pcVar5;
  int iVar6;
  int *piVar7;
  
  iVar3 = *(int *)(gpGlobals + 0x18) - (int)(120.0 / *(float *)(gpGlobals + 0x1c) + 0.5);
  if (iVar3 < 0) {
    iVar3 = 0;
  }
  RemoveEventsFromHistory(this,iVar3);
  if (*(float *)(this + 0x18) <= 10.0 && *(float *)(this + 0x18) != 10.0) {
                    /* WARNING: Could not recover jumptable at 0x006dc2ff. Too many branches */
                    /* WARNING: Treating indirect jump as call */
    (**(code **)(*(int *)this + 0x74))();
    return;
  }
  if (0 < *(int *)(this + 0x30)) {
    UNRECOVERED_JUMPTABLE = *(code **)(*(int *)this + 0x78);
LAB_006dc1a4:
                    /* WARNING: Could not recover jumptable at 0x006dc1ab. Too many branches */
                    /* WARNING: Treating indirect jump as call */
    (*UNRECOVERED_JUMPTABLE)();
    return;
  }
  cVar1 = (**(code **)(*(int *)this + 0x70))(this);
  if (cVar1 == '\0') {
    iVar3 = *(int *)(this + 0x1c);
    *(int *)(this + 0x38) = (int)(8.0 / *(float *)(gpGlobals + 0x1c) + 0.5) + iVar3;
    if (iVar3 < 1) {
      piVar7 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"hltv_message",1,0);
      if (piVar7 != (int *)0x0) {
        (**(code **)(*piVar7 + 0x3c))(piVar7,"text","Please wait for broadcast to start ...");
        (**(code **)(**(int **)(this + 0x14) + 0x2c))(*(int **)(this + 0x14),piVar7);
        (**(code **)(*gameeventmanager + 0x2c))(gameeventmanager,piVar7);
      }
      (**(code **)(*(int *)this + 0x54))(this,1);
    }
    else {
      uVar4 = FindFirstEvent(this,iVar3);
      if (uVar4 == 0xffff) {
LAB_006dc29e:
        iVar6 = *(int *)(this + 0x38);
      }
      else {
        uVar4 = uVar4 & 0xffff;
        iVar3 = *(int *)(this + 0x1d4) + uVar4 * 0x14;
        iVar6 = *(int *)(this + 0x38);
        if (*(int *)(iVar3 + 8) < iVar6) {
          do {
            pcVar5 = (char *)(**(code **)(**(int **)(iVar3 + 0x10) + 8))(*(int **)(iVar3 + 0x10));
            iVar6 = _V_strcmp(pcVar5,"hltv_cameraman");
            if (iVar6 == 0) {
              iVar6 = (**(code **)(**(int **)(iVar3 + 0x10) + 0x1c))
                                (*(int **)(iVar3 + 0x10),"index",0);
              if (0 < iVar6) {
                iVar6 = *(int *)(iVar3 + 8);
                *(int *)(this + 0x38) = iVar6;
                break;
              }
            }
            uVar2 = CUtlRBTree<CGameEvent,unsigned_short,bool(*)(CGameEvent_const&,CGameEvent_const&),CUtlMemory<UtlRBTreeNode_t<CGameEvent,unsigned_short>,unsigned_short>>
                    ::NextInorder((CUtlRBTree<CGameEvent,unsigned_short,bool(*)(CGameEvent_const&,CGameEvent_const&),CUtlMemory<UtlRBTreeNode_t<CGameEvent,unsigned_short>,unsigned_short>>
                                   *)(this + 0x1d0),(ushort)uVar4);
            if (uVar2 == 0xffff) goto LAB_006dc29e;
            uVar4 = (uint)uVar2;
            iVar3 = *(int *)(this + 0x1d4) + uVar4 * 0x14;
            iVar6 = *(int *)(this + 0x38);
          } while (*(int *)(iVar3 + 8) < iVar6);
        }
      }
      if (4.0 <= (float)(iVar6 - *(int *)(this + 0x1c)) * *(float *)(gpGlobals + 0x1c)) {
        iVar3 = (**(code **)(*(int *)this + 0x80))(this);
        if (iVar3 == 0) {
          UNRECOVERED_JUMPTABLE = *(code **)(*(int *)this + 0x4c);
          goto LAB_006dc1a4;
        }
        (**(code **)(*(int *)this + 0x84))(this,iVar3);
      }
    }
  }
  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)