L L4D2node

CVomit::UpdateAbility

0x004e5f20 · 2661 bytes · __thiscall

_ZN6CVomit13UpdateAbilityEv

Decompiled

undefined (1 param)

/* CVomit::UpdateAbility() */

void __thiscall CVomit::UpdateAbility(CVomit *this)

{
  uint uVar1;
  CBaseEntity *this_00;
  CBaseEdict *pCVar2;
  code *pcVar3;
  char cVar4;
  QAngle *pQVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  undefined *puVar9;
  undefined4 *puVar10;
  longdouble lVar11;
  float fVar12;
  float fVar13;
  float local_170;
  float local_16c;
  float local_168;
  float local_164;
  float local_15c;
  float local_158;
  float local_154;
  Vector local_150 [12];
  Vector local_144 [12];
  float local_138;
  float local_134;
  float local_130;
  float local_12c;
  float local_128;
  float local_124;
  float local_120;
  float local_11c;
  float local_118;
  undefined **local_114 [4];
  undefined4 local_104 [3];
  undefined4 local_f8;
  undefined4 local_f4;
  undefined **local_f0 [4];
  undefined4 local_e0 [3];
  undefined4 local_d4;
  undefined4 local_d0;
  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;
  Vector local_70 [12];
  Vector local_64 [32];
  float local_44;
  int local_24;
  
  uVar1 = *(uint *)(this + 0x44c);
  if ((((uVar1 != 0xffffffff) &&
       (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar9 + 8) == uVar1 >> 0xc)) &&
     ((this_00 = *(CBaseEntity **)(puVar9 + 4), this_00 != (CBaseEntity *)0x0 &&
      (this[0x45d] != (CVomit)0x0)))) {
    lVar11 = (longdouble)CountdownTimer::Now();
    if (*(float *)(this + 0x468) <= (float)lVar11) {
      if (*(float *)(this_00 + 0x2848) != 0.0) {
        if (this_00[0x6c] == (CBaseEntity)0x0) {
          pCVar2 = *(CBaseEdict **)(this_00 + 0x30);
          if (pCVar2 != (CBaseEdict *)0x0) {
            *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
            iVar8 = CBaseEdict::GetChangeAccessor(pCVar2);
            *(undefined2 *)(iVar8 + 2) = 0;
          }
        }
        else {
          this_00[0x70] = (CBaseEntity)((byte)this_00[0x70] | 1);
        }
        *(undefined4 *)(this_00 + 0x2848) = 0;
      }
      if (this[0x45d] != (CVomit)0x0) {
        if (this[0x6c] == (CVomit)0x0) {
          pCVar2 = *(CBaseEdict **)(this + 0x30);
          if (pCVar2 != (CBaseEdict *)0x0) {
            *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
            iVar8 = CBaseEdict::GetChangeAccessor(pCVar2);
            *(undefined2 *)(iVar8 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CVomit)((byte)this[0x70] | 1);
        }
        this[0x45d] = (CVomit)0x0;
      }
      StopVomitEffect(this);
      if (*(float *)(this + 0x474) != -1.0) {
        (**(code **)(*(int *)(this + 0x46c) + 4))();
        *(undefined4 *)(this + 0x474) = 0xbf800000;
      }
      if (*(float *)(this + 0x468) != -1.0) {
        (**(code **)(*(int *)(this + 0x460) + 4))();
        *(undefined4 *)(this + 0x468) = 0xbf800000;
      }
      CBaseAbility::StartActivationTimer
                ((CBaseAbility *)this,*(float *)(ZombieVomitInterval._28_4_ + 0x2c),0.0);
      return;
    }
    fVar12 = *(float *)(ZombieVomitFatigue._28_4_ + 0x2c);
    if (fVar12 != *(float *)(this_00 + 0x2848)) {
      if (this_00[0x6c] == (CBaseEntity)0x0) {
        pCVar2 = *(CBaseEdict **)(this_00 + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar8 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar8 + 2) = 0;
        }
      }
      else {
        this_00[0x70] = (CBaseEntity)((byte)this_00[0x70] | 1);
      }
      *(float *)(this_00 + 0x2848) = fVar12;
    }
    if (*(float *)(gpGlobals + 0x10) != 0.0) {
      cVar4 = (**(code **)(*(int *)this_00 + 0x778))();
      if (cVar4 == '\0') {
        (**(code **)*lagcompensation)();
        lVar11 = (longdouble)CountdownTimer::Now();
        puVar10 = (undefined4 *)&stack0xfffffe54;
        if (*(float *)(this + 0x474) <= (float)lVar11) {
          pQVar5 = (QAngle *)(**(code **)(*(int *)this_00 + 0x238))();
          AngleVectors(pQVar5,(Vector *)&local_15c,local_150,local_144);
          (**(code **)(*(int *)this_00 + 0x234))();
          local_12c = vec3_origin;
          local_128 = DAT_01053d4c;
          local_124 = DAT_01053d50;
          fVar12 = *(float *)(z_vomit_vecrand._28_4_ + 0x2c);
          fVar13 = fVar12 * -2100.0;
          iVar8 = rand();
          fVar12 = (fVar12 * 2100.0 - fVar13) * 3.051851e-05;
          iVar6 = rand();
          iVar7 = rand();
          local_168 = (float)iVar8 * fVar12 + local_15c * 2100.0 + fVar13;
          local_164 = (float)iVar6 * fVar12 + local_158 * 2100.0 + fVar13;
          local_16c = (float)iVar7 * fVar12 + fVar13 + local_154 * 2100.0;
          lVar11 = (longdouble)(**(code **)(*random_valve + 4))();
          local_170 = 0.0;
          while( true ) {
            local_120 = local_138;
            local_11c = local_134;
            local_118 = local_130;
            fVar12 = *(float *)(gpGlobals + 0x10);
            local_170 = fVar12 + local_170;
            local_134 = local_164 * fVar12 + local_134;
            local_130 = local_16c * fVar12 + local_130;
            local_138 = local_168 * fVar12 + local_138;
            puVar10 = (undefined4 *)&stack0xfffffe50;
            if ((float)lVar11 * 0.5 < local_170) break;
            local_168 = local_168 * 0.86;
            local_164 = local_164 * 0.86;
            local_16c = local_16c * 0.86 - 110.0;
            if (*(int *)(z_vomit_debug._28_4_ + 0x30) != 0) {
              NDebugOverlay::Line((Vector *)&local_120,(Vector *)&local_138,0,0xff,0,true,5.0);
            }
            (**(code **)(*(int *)this + 0x2c8))();
            CTraceFilterSimpleList::CTraceFilterSimpleList((CTraceFilterSimpleList *)local_114,0);
                    /* try { // try from 004e660d to 004e6611 has its CatchHandler @ 004e6a3b */
            CTraceFilterSimpleList::CTraceFilterSimpleList((CTraceFilterSimpleList *)local_f0,0);
            local_f0[0] = &PTR_ShouldHitEntity_00c254d0;
                    /* try { // try from 004e661c to 004e6646 has its CatchHandler @ 004e69c5 */
            cVar4 = CTerrorGameRules::HasPlayerControlledZombies();
            if (cVar4 == '\0') {
              CTraceFilterSimpleList::AddEntityToIgnore
                        ((CTraceFilterSimpleList *)local_114,(IHandleEntity *)this);
              CTraceFilterSimpleList::AddEntityToIgnore
                        ((CTraceFilterSimpleList *)local_114,(IHandleEntity *)this_00);
            }
            else {
                    /* try { // try from 004e62fb to 004e645a has its CatchHandler @ 004e69c5 */
              CTraceFilterSimpleList::AddEntityToIgnore
                        ((CTraceFilterSimpleList *)local_f0,(IHandleEntity *)this);
              CTraceFilterSimpleList::AddEntityToIgnore
                        ((CTraceFilterSimpleList *)local_f0,(IHandleEntity *)this_00);
            }
            local_88 = 1;
            local_cc = local_120;
            local_c4 = local_118;
            local_bc = local_138 - local_120;
            local_94 = 0;
            local_b4 = local_130 - local_118;
            local_98 = 0;
            local_9c = 0;
            local_b8 = local_134 - local_11c;
            local_8c = 0;
            local_a4 = 0;
            local_a8 = 0;
            local_ac = 0;
            local_c8 = local_11c;
            local_87 = local_bc * local_bc + local_b4 * local_b4 + local_b8 * local_b8 != 0.0;
            (**(code **)(*enginetrace + 0x14))();
            if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
              DebugDrawLine(local_70,local_64,0xff,0,0,true,-1.0);
            }
            if ((local_44 < 1.0) && (local_24 != 0)) {
              if (*(int *)(z_vomit_debug._28_4_ + 0x30) != 0) {
                    /* try { // try from 004e6852 to 004e68eb has its CatchHandler @ 004e69c5 */
                NDebugOverlay::Line((Vector *)&local_120,(Vector *)&local_138,0xff,100,0,true,10.0);
              }
              CBaseEntity::GetTeamNumber(this_00);
              local_12c = local_168;
              local_128 = local_164;
              local_124 = local_16c;
              OnVomitCollide();
              local_f0[0] = &PTR_ShouldHitEntity_00c54590;
              local_d4 = 0;
              CUtlMemory<IHandleEntity*,int>::Purge((CUtlMemory<IHandleEntity*,int> *)local_e0);
              local_d0 = local_e0[0];
              CUtlMemory<IHandleEntity*,int>::Purge((CUtlMemory<IHandleEntity*,int> *)local_e0);
              local_114[0] = &PTR_ShouldHitEntity_00c54590;
              local_f8 = 0;
              CUtlMemory<IHandleEntity*,int>::Purge((CUtlMemory<IHandleEntity*,int> *)local_104);
              local_f4 = local_104[0];
              CUtlMemory<IHandleEntity*,int>::Purge((CUtlMemory<IHandleEntity*,int> *)local_104);
              puVar10 = (undefined4 *)&stack0xfffffe50;
              break;
            }
            local_f0[0] = &PTR_ShouldHitEntity_00c54590;
            local_d4 = 0;
            CUtlMemory<IHandleEntity*,int>::Purge((CUtlMemory<IHandleEntity*,int> *)local_e0);
            local_d0 = local_e0[0];
            CUtlMemory<IHandleEntity*,int>::Purge((CUtlMemory<IHandleEntity*,int> *)local_e0);
            local_114[0] = &PTR_ShouldHitEntity_00c54590;
            local_f8 = 0;
            CUtlMemory<IHandleEntity*,int>::Purge((CUtlMemory<IHandleEntity*,int> *)local_104);
            local_f4 = local_104[0];
            CUtlMemory<IHandleEntity*,int>::Purge((CUtlMemory<IHandleEntity*,int> *)local_104);
          }
        }
        iVar8 = *lagcompensation;
        *puVar10 = lagcompensation;
        puVar10[1] = this_00;
        pcVar3 = *(code **)(iVar8 + 4);
        puVar10[-1] = 0x4e6977;
        (*pcVar3)();
      }
      else {
        lVar11 = (longdouble)CountdownTimer::Now();
        if (*(float *)(this + 0x474) <= (float)lVar11) {
          pQVar5 = (QAngle *)(**(code **)(*(int *)this_00 + 0x238))();
          (**(code **)(*(int *)this_00 + 0x234))();
          CVomitParticle::Create(local_70,pQVar5,(CBaseEntity *)this,(CTerrorPlayer *)this_00);
        }
      }
    }
  }
  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)