L L4D2node

CResponseSystem::FakeDepletes

0x005b6c10 · 381 bytes · __thiscall

_ZN15CResponseSystem12FakeDepletesEP13ResponseGroupP15IResponseFilter

Decompiled

undefined (3 params)

/* CResponseSystem::FakeDepletes(ResponseGroup*, IResponseFilter*) */

void __thiscall
CResponseSystem::FakeDepletes(CResponseSystem *this,ResponseGroup *param_1,IResponseFilter *param_2)

{
  int iVar1;
  char cVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  int local_20 [4];
  
  *(undefined4 *)(this + 0x38c0) = 0;
  iVar1 = *(int *)(param_1 + 8);
  if (((param_2 != (IResponseFilter *)0x0) && (((byte)param_1[0x13] & 1) != 0)) &&
     (local_20[0] = 0, 0 < iVar1)) {
    do {
      while ((iVar3 = local_20[0] * 0x50 + *(int *)param_1,
             *(ResponseGroup *)(iVar3 + 0x2e) == param_1[0x12] ||
             (cVar2 = (*(code *)**(undefined4 **)param_2)
                                (param_2,*(byte *)(iVar3 + 0x2f) & 0x3f,
                                 *(undefined4 *)(iVar3 + 0x28)), cVar2 != '\0'))) {
        local_20[0] = local_20[0] + 1;
        if (iVar1 <= local_20[0]) goto LAB_005b6ced;
      }
      CUtlVector<int,CUtlMemory<int,int>>::InsertBefore
                ((CUtlVector<int,CUtlMemory<int,int>> *)(this + 0x38b4),*(int *)(this + 0x38c0),
                 local_20);
      if ((((byte)param_1[0x13] & 1) != 0) &&
         ((-1 < local_20[0] && (local_20[0] < *(int *)(param_1 + 8))))) {
        *(ResponseGroup *)(local_20[0] * 0x50 + *(int *)param_1 + 0x2e) = param_1[0x12];
      }
      local_20[0] = local_20[0] + 1;
    } while (local_20[0] < iVar1);
  }
LAB_005b6ced:
  local_20[0] = 0;
  if (0 < iVar1) {
    do {
      while ((((iVar5 = local_20[0] * 0x50, iVar3 = *(int *)param_1, iVar4 = RandomInt(1,100),
               iVar4 <= *(short *)(iVar5 + iVar3 + 0xc) ||
               (CUtlVector<int,CUtlMemory<int,int>>::InsertBefore
                          ((CUtlVector<int,CUtlMemory<int,int>> *)(this + 0x38b4),
                           *(int *)(this + 0x38c0),local_20), ((byte)param_1[0x13] & 1) == 0)) ||
              (local_20[0] < 0)) || (*(int *)(param_1 + 8) <= local_20[0]))) {
        local_20[0] = local_20[0] + 1;
        if (iVar1 <= local_20[0]) {
          return;
        }
      }
      iVar3 = local_20[0] + 1;
      *(ResponseGroup *)(local_20[0] * 0x50 + *(int *)param_1 + 0x2e) = param_1[0x12];
      local_20[0] = iVar3;
    } while (iVar3 < iVar1);
  }
  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)