L L4D2node

CLunge::UpdateAbility

0x004d9840 · 560 bytes · __thiscall

_ZN6CLunge13UpdateAbilityEv

Decompiled

undefined (1 param)

/* CLunge::UpdateAbility() */

void __thiscall CLunge::UpdateAbility(CLunge *this)

{
  float fVar1;
  uint uVar2;
  CTerrorPlayer *this_00;
  CBaseEdict *pCVar3;
  int iVar4;
  undefined *puVar5;
  longdouble lVar6;
  
  if ((((((this[0x47c] == (CLunge)0x0) || (uVar2 = *(uint *)(this + 0x44c), uVar2 == 0xffffffff)) ||
        (puVar5 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar5 == (undefined *)0xfffffffc)) ||
       ((*(uint *)(puVar5 + 8) != uVar2 >> 0xc ||
        (this_00 = *(CTerrorPlayer **)(puVar5 + 4), this_00 == (CTerrorPlayer *)0x0)))) ||
      ((*(float *)(this + 0x470) <= -0.01 ||
       ((0.01 <= *(float *)(this + 0x470) || (*(float *)(this + 0x474) <= -0.01)))))) ||
     ((0.01 <= *(float *)(this + 0x474) ||
      ((*(float *)(this + 0x478) <= -0.01 || (0.01 <= *(float *)(this + 0x478))))))) {
    return;
  }
  if (this_00[0x186] != (CTerrorPlayer)0x9) {
    iVar4 = CBaseEntity::GetGroundEntity((CBaseEntity *)this_00);
    if (iVar4 == 0) {
      return;
    }
    if (*(float *)(gpGlobals + 0xc) <= *(float *)(this + 0x46c) + 0.5) {
      return;
    }
    if (this[0x47c] == (CLunge)0x0) goto LAB_004d991c;
  }
  if (this[0x6c] == (CLunge)0x0) {
    pCVar3 = *(CBaseEdict **)(this + 0x30);
    if (pCVar3 != (CBaseEdict *)0x0) {
      *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
      iVar4 = CBaseEdict::GetChangeAccessor(pCVar3);
      *(undefined2 *)(iVar4 + 2) = 0;
    }
  }
  else {
    this[0x70] = (CLunge)((byte)this[0x70] | 1);
  }
  this[0x47c] = (CLunge)0x0;
LAB_004d991c:
  if (*(float *)(this + 0x46c) != 0.0) {
    if (this[0x6c] == (CLunge)0x0) {
      pCVar3 = *(CBaseEdict **)(this + 0x30);
      if (pCVar3 != (CBaseEdict *)0x0) {
        *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
        iVar4 = CBaseEdict::GetChangeAccessor(pCVar3);
        *(undefined2 *)(iVar4 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CLunge)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x46c) = 0;
  }
  CBaseAbility::StartActivationTimer
            ((CBaseAbility *)this,*(float *)(ZombieLungeInterval._28_4_ + 0x2c),0.0);
  fVar1 = *(float *)(ZombieLungeCooldown._28_4_ + 0x2c);
  lVar6 = (longdouble)CountdownTimer::Now();
  if ((float)lVar6 + fVar1 != *(float *)(this + 0x488)) {
    (**(code **)(*(int *)(this + 0x480) + 4))(this + 0x480,this + 0x488);
    *(float *)(this + 0x488) = (float)lVar6 + fVar1;
  }
  if (fVar1 != *(float *)(this + 0x484)) {
    (**(code **)(*(int *)(this + 0x480) + 4))(this + 0x480,this + 0x484);
    *(float *)(this + 0x484) = fVar1;
  }
  CTerrorPlayer::OnLungeEnd(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)