L L4D2node

CFishPool::Update

0x006a60d0 · 1877 bytes · __thiscall

_ZN9CFishPool6UpdateEv

Decompiled

undefined (1 param)

/* CFishPool::Update() */

void __thiscall CFishPool::Update(CFishPool *this)

{
  float fVar1;
  uint uVar2;
  bool bVar3;
  char cVar4;
  int iVar5;
  uint uVar6;
  CBaseEntity *pCVar7;
  CFish *pCVar8;
  undefined *puVar9;
  undefined *puVar10;
  int *piVar11;
  int iVar12;
  CBaseEntity *this_00;
  longdouble lVar13;
  int local_100;
  IHandleEntity *local_fc;
  int local_f4;
  int local_f0;
  CFish *local_e4;
  CFish *local_e0;
  CTraceFilterSimple local_dc [16];
  float local_cc;
  float local_c8;
  float local_c4;
  float local_bc;
  float local_b8;
  float local_b4;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_8c;
  undefined1 local_88;
  undefined1 local_87;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  Vector local_64 [32];
  float local_44;
  
  CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 0.1,(char *)0x0);
  if (*(int *)(fish_dormant._28_4_ + 0x30) == 0) {
    this[0x45c] = (CFishPool)0x0;
    lVar13 = (longdouble)CountdownTimer::Now();
    if (*(float *)(this + 0x47c) <= (float)lVar13) {
      lVar13 = (longdouble)CountdownTimer::Now();
      fVar1 = *(float *)(this + 0x478);
      if ((float)lVar13 + fVar1 != *(float *)(this + 0x47c)) {
        (**(code **)(*(int *)(this + 0x474) + 4))(this + 0x474,this + 0x47c);
        *(float *)(this + 0x47c) = (float)lVar13 + fVar1;
      }
      puVar10 = g_pEntityList;
      iVar12 = *(int *)(this + 0x46c);
      if (0 < iVar12) {
        iVar5 = 0;
        do {
          iVar12 = 0;
          uVar6 = *(uint *)(*(int *)(this + 0x460) + iVar5 * 4);
          if (((uVar6 != 0xffffffff) &&
              (puVar9 = puVar10 + (uVar6 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
             (*(uint *)(puVar9 + 8) == uVar6 >> 0xc)) {
            iVar12 = *(int *)(puVar9 + 4);
          }
          *(undefined4 *)(iVar12 + 0x1498) = 0;
          iVar5 = iVar5 + 1;
          iVar12 = *(int *)(this + 0x46c);
        } while (iVar5 < iVar12);
        if (0 < iVar12) {
          local_100 = 1;
          do {
            iVar5 = (local_100 + 0x3fffffff) * 4;
            uVar6 = *(uint *)(*(int *)(this + 0x460) + (local_100 + 0x3fffffff) * 4);
            piVar11 = (int *)0x0;
            if (((uVar6 != 0xffffffff) &&
                (puVar10 = puVar10 + (uVar6 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
               (*(uint *)(puVar10 + 8) == uVar6 >> 0xc)) {
              piVar11 = *(int **)(puVar10 + 4);
            }
            cVar4 = (**(code **)(*piVar11 + 300))(piVar11);
            iVar12 = *(int *)(this + 0x46c);
            if (cVar4 != '\0') {
              if (iVar12 <= local_100) break;
              local_f4 = local_100;
              local_f0 = iVar5;
              do {
                local_f0 = local_f0 + 4;
                piVar11 = (int *)0x0;
                uVar6 = *(uint *)(*(int *)(this + 0x460) + local_f0);
                if (((uVar6 != 0xffffffff) &&
                    (puVar10 = g_pEntityList + (uVar6 & 0xfff) * 0x10,
                    puVar10 != (undefined *)0xfffffffc)) && (*(uint *)(puVar10 + 8) == uVar6 >> 0xc)
                   ) {
                  piVar11 = *(int **)(puVar10 + 4);
                }
                cVar4 = (**(code **)(*piVar11 + 300))(piVar11);
                if (cVar4 != '\0') {
                  local_fc = (IHandleEntity *)0x0;
                  uVar6 = *(uint *)(*(int *)(this + 0x460) + iVar5);
                  if (((uVar6 != 0xffffffff) &&
                      (puVar10 = g_pEntityList + (uVar6 & 0xfff) * 0x10,
                      puVar10 != (undefined *)0xfffffffc)) &&
                     (*(uint *)(puVar10 + 8) == uVar6 >> 0xc)) {
                    local_fc = *(IHandleEntity **)(puVar10 + 4);
                  }
                  pCVar7 = (CBaseEntity *)0x0;
                  uVar2 = *(uint *)(*(int *)(this + 0x460) + local_f0);
                  if (((uVar2 != 0xffffffff) &&
                      (puVar10 = g_pEntityList + (uVar2 & 0xfff) * 0x10,
                      puVar10 != (undefined *)0xfffffffc)) &&
                     (*(uint *)(puVar10 + 8) == uVar2 >> 0xc)) {
                    pCVar7 = *(CBaseEntity **)(puVar10 + 4);
                  }
                  if (((byte)pCVar7[0x14d] & 8) != 0) {
                    CBaseEntity::CalcAbsolutePosition(pCVar7);
                    uVar6 = *(uint *)(*(int *)(this + 0x460) + iVar5);
                  }
                  this_00 = (CBaseEntity *)0x0;
                  if (((uVar6 != 0xffffffff) &&
                      (puVar10 = g_pEntityList + (uVar6 & 0xfff) * 0x10,
                      puVar10 != (undefined *)0xfffffffc)) &&
                     (*(uint *)(puVar10 + 8) == uVar6 >> 0xc)) {
                    this_00 = *(CBaseEntity **)(puVar10 + 4);
                  }
                  if (((byte)this_00[0x14d] & 8) != 0) {
                    CBaseEntity::CalcAbsolutePosition(this_00);
                  }
                  local_cc = *(float *)(this_00 + 0x2e0);
                  local_94 = 0;
                  local_c4 = *(float *)(this_00 + 0x2e8);
                  local_88 = 1;
                  local_bc = *(float *)(pCVar7 + 0x2e0) - local_cc;
                  local_c8 = *(float *)(this_00 + 0x2e4);
                  local_98 = 0;
                  local_b4 = *(float *)(pCVar7 + 0x2e8) - local_c4;
                  local_b8 = *(float *)(pCVar7 + 0x2e4) - local_c8;
                  local_9c = 0;
                  local_8c = 0;
                  local_a4 = 0;
                  local_a8 = 0;
                  local_ac = 0;
                  local_87 = local_b4 * local_b4 + local_bc * local_bc + local_b8 * local_b8 != 0.0;
                  CTraceFilterSimple::CTraceFilterSimple
                            (local_dc,local_fc,0,(_func_bool_IHandleEntity_ptr_int *)0x0);
                  (**(code **)(*enginetrace + 0x14))
                            (enginetrace,&local_cc,0x200400b,local_dc,(Vector *)&local_70);
                  if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
                    DebugDrawLine((Vector *)&local_70,local_64,0xff,0,0,true,-1.0);
                  }
                  if (1.0 <= local_44) {
                    local_e4 = (CFish *)0x0;
                    uVar6 = *(uint *)(*(int *)(this + 0x460) + local_f0);
                    if (((uVar6 != 0xffffffff) &&
                        (puVar10 = g_pEntityList + (uVar6 & 0xfff) * 0x10,
                        puVar10 != (undefined *)0xfffffffc)) &&
                       (*(uint *)(puVar10 + 8) == uVar6 >> 0xc)) {
                      local_e4 = *(CFish **)(puVar10 + 4);
                    }
                    uVar6 = *(uint *)(*(int *)(this + 0x460) + iVar5);
                    iVar12 = 0;
                    if (((uVar6 != 0xffffffff) &&
                        (puVar10 = g_pEntityList + (uVar6 & 0xfff) * 0x10,
                        puVar10 != (undefined *)0xfffffffc)) &&
                       (*(uint *)(puVar10 + 8) == uVar6 >> 0xc)) {
                      iVar12 = *(int *)(puVar10 + 4);
                    }
                    pCVar8 = (CFish *)0x0;
                    CUtlVector<CFish*,CUtlMemory<CFish*,int>>::InsertBefore
                              ((CUtlVector<CFish*,CUtlMemory<CFish*,int>> *)(iVar12 + 0x148c),
                               *(int *)(iVar12 + 0x1498),&local_e4);
                    uVar6 = *(uint *)(*(int *)(this + 0x460) + iVar5);
                    if (((uVar6 != 0xffffffff) &&
                        (puVar10 = g_pEntityList + (uVar6 & 0xfff) * 0x10,
                        puVar10 != (undefined *)0xfffffffc)) &&
                       (*(uint *)(puVar10 + 8) == uVar6 >> 0xc)) {
                      pCVar8 = *(CFish **)(puVar10 + 4);
                    }
                    uVar6 = *(uint *)(*(int *)(this + 0x460) + local_f0);
                    iVar12 = 0;
                    if (((uVar6 != 0xffffffff) &&
                        (puVar10 = g_pEntityList + (uVar6 & 0xfff) * 0x10,
                        puVar10 != (undefined *)0xfffffffc)) &&
                       (*(uint *)(puVar10 + 8) == uVar6 >> 0xc)) {
                      iVar12 = *(int *)(puVar10 + 4);
                    }
                    local_e0 = pCVar8;
                    CUtlVector<CFish*,CUtlMemory<CFish*,int>>::InsertBefore
                              ((CUtlVector<CFish*,CUtlMemory<CFish*,int>> *)(iVar12 + 0x148c),
                               *(int *)(iVar12 + 0x1498),&local_e0);
                  }
                }
                local_f4 = local_f4 + 1;
                iVar12 = *(int *)(this + 0x46c);
              } while (local_f4 < iVar12);
            }
            bVar3 = local_100 < iVar12;
            puVar10 = g_pEntityList;
            local_100 = local_100 + 1;
          } while (bVar3);
        }
      }
    }
    else {
      iVar12 = *(int *)(this + 0x46c);
    }
    if (0 < iVar12) {
      iVar12 = 0;
      do {
        pCVar8 = (CFish *)0x0;
        uVar6 = *(uint *)(*(int *)(this + 0x460) + iVar12 * 4);
        if (((uVar6 != 0xffffffff) &&
            (puVar10 = g_pEntityList + (uVar6 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc))
           && (*(uint *)(puVar10 + 8) == uVar6 >> 0xc)) {
          pCVar8 = *(CFish **)(puVar10 + 4);
        }
        iVar12 = iVar12 + 1;
        CFish::Update(pCVar8,0.1);
      } while (iVar12 < *(int *)(this + 0x46c));
    }
  }
  else if (this[0x45c] == (CFishPool)0x0) {
    iVar12 = 0;
    if (0 < *(int *)(this + 0x46c)) {
      do {
        local_70 = 0;
        pCVar7 = (CBaseEntity *)0x0;
        local_6c = 0;
        local_68 = 0;
        uVar6 = *(uint *)(*(int *)(this + 0x460) + iVar12 * 4);
        if (((uVar6 != 0xffffffff) &&
            (puVar10 = g_pEntityList + (uVar6 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc))
           && (*(uint *)(puVar10 + 8) == uVar6 >> 0xc)) {
          pCVar7 = *(CBaseEntity **)(puVar10 + 4);
        }
        iVar12 = iVar12 + 1;
        CBaseEntity::SetAbsVelocity(pCVar7,(Vector *)&local_70);
      } while (iVar12 < *(int *)(this + 0x46c));
    }
    this[0x45c] = (CFishPool)0x1;
  }
  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)