L L4D2node

CLunge::IsAbilityReadyToFire

0x004da130 · 410 bytes · __thiscall

_ZNK6CLunge20IsAbilityReadyToFireEv

Decompiled

undefined (1 param)

/* CLunge::IsAbilityReadyToFire() const */

undefined4 __thiscall CLunge::IsAbilityReadyToFire(CLunge *this)

{
  uint uVar1;
  CLunge *pCVar2;
  code *pcVar3;
  char cVar4;
  undefined4 uVar5;
  int *piVar6;
  undefined *puVar7;
  longdouble lVar8;
  CLunge *this_00;
  
  uVar1 = *(uint *)(this + 0x44c);
  if ((((((uVar1 != 0xffffffff) &&
         (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
        (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) &&
       ((pCVar2 = *(CLunge **)(puVar7 + 4), pCVar2 != (CLunge *)0x0 &&
        (this_00 = pCVar2, cVar4 = (**(code **)(*(int *)pCVar2 + 0x558))(), cVar4 == '\0')))) &&
      (((uVar1 = *(uint *)(pCVar2 + 0x3e64), uVar1 == 0xffffffff ||
        ((puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc ||
         (*(uint *)(puVar7 + 8) != uVar1 >> 0xc)))) || (*(int *)(puVar7 + 4) == 0)))) &&
     (((byte)pCVar2[0x1cb1] & 8) == 0)) {
    if (0.0 < *(float *)(this + 0x448)) {
      this_00 = this + 0x440;
      lVar8 = (longdouble)CountdownTimer::Now();
      if ((float)lVar8 < *(float *)(this + 0x448)) {
        return 0;
      }
    }
    cVar4 = CTerrorGameRules::HasPlayerControlledZombies();
    if ((cVar4 == '\0') || (pCVar2[0x1a90] != (CLunge)0x0)) {
      if ((this[0x47d] == (CLunge)0x0) && (cVar4 = CanLungeAgain(this_00), cVar4 != '\0')) {
        return 1;
      }
      if (this[0x47c] == (CLunge)0x0) {
        uVar5 = CBaseAbility::IsAbilityReadyToFire((CBaseAbility *)this);
        return uVar5;
      }
    }
    else {
      piVar6 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"pounce_fail",0,0);
      if (piVar6 != (int *)0x0) {
        pcVar3 = *(code **)(*piVar6 + 0x30);
        uVar5 = (**(code **)(*engine + 0x40))(engine,*(int *)(pCVar2 + 0x30));
        (*pcVar3)(piVar6,"userid",uVar5);
        (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar6,0);
        return 0;
      }
    }
  }
  return 0;
}

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)