L L4D2node

CHLTVDirector::StartRandomShot

0x006d9fe0 · 144 bytes · __thiscall

_ZN13CHLTVDirector15StartRandomShotEv

Decompiled

undefined (1 param)

/* CHLTVDirector::StartRandomShot() */

void __thiscall CHLTVDirector::StartRandomShot(CHLTVDirector *this)

{
  int iVar1;
  longdouble lVar2;
  
  iVar1 = (int)(6.0 / *(float *)(gpGlobals + 0x1c) + 0.5) + *(int *)(this + 0x1c);
  if (*(int *)(this + 0x38) < iVar1) {
    iVar1 = *(int *)(this + 0x38);
  }
  *(int *)(this + 0x38) = iVar1;
  lVar2 = (longdouble)RandomFloat(0,0x3f800000);
  if (((float)lVar2 < 0.25) && (*(int *)(tv_allow_static_shots._28_4_ + 0x30) != 0)) {
    (**(code **)(*(int *)this + 0x54))(this,0);
    return;
  }
                    /* WARNING: Could not recover jumptable at 0x006da075. Too many branches */
                    /* WARNING: Treating indirect jump as call */
  (**(code **)(*(int *)this + 0x58))();
  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)