L L4D2node

CBaseAbility::IsAbilityReadyToFire

0x004d1e40 · 432 bytes · __thiscall

_ZNK12CBaseAbility20IsAbilityReadyToFireEv

Decompiled

undefined (1 param)

/* CBaseAbility::IsAbilityReadyToFire() const */

bool __thiscall CBaseAbility::IsAbilityReadyToFire(CBaseAbility *this)

{
  int *piVar1;
  char cVar2;
  uint uVar3;
  int iVar4;
  undefined4 uVar5;
  CTerrorPlayer *pCVar6;
  int *piVar7;
  undefined *puVar8;
  uint uVar9;
  longdouble lVar10;
  longdouble extraout_ST0;
  
  if ((0.0 < *(float *)(this + 0x448)) &&
     (lVar10 = (longdouble)CountdownTimer::Now(), (float)lVar10 < *(float *)(this + 0x448))) {
    return false;
  }
  uVar3 = *(uint *)(this + 0x44c);
  if (uVar3 != 0xffffffff) {
    uVar9 = uVar3 & 0xfff;
    piVar7 = (int *)(g_pEntityList + uVar9 * 0x10 + 4);
    if (piVar7 != (int *)0x0) {
      if ((*(uint *)(g_pEntityList + uVar9 * 0x10 + 8) == uVar3 >> 0xc) &&
         (piVar1 = *(int **)(g_pEntityList + uVar9 * 0x10 + 4), piVar1 != (int *)0x0)) {
        cVar2 = (**(code **)(*piVar1 + 0x7e8))(piVar1);
        if (cVar2 != '\0') {
          return false;
        }
        uVar3 = *(uint *)(this + 0x44c);
        if ((uVar3 == 0xffffffff) ||
           (piVar7 = (int *)(g_pEntityList + (uVar3 & 0xfff) * 0x10 + 4), piVar7 == (int *)0x0))
        goto LAB_004d1ebc;
      }
      if (piVar7[1] == uVar3 >> 0xc) {
        iVar4 = *piVar7;
        goto LAB_004d1ebe;
      }
    }
  }
LAB_004d1ebc:
  iVar4 = 0;
LAB_004d1ebe:
  uVar5 = CMultiPlayerAnimState::GetMainActivity(*(CMultiPlayerAnimState **)(iVar4 + 0x2910));
  uVar3 = *(uint *)(this + 0x44c);
  pCVar6 = (CTerrorPlayer *)0x0;
  if (((uVar3 != 0xffffffff) &&
      (puVar8 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar8 + 8) == uVar3 >> 0xc)) {
    pCVar6 = *(CTerrorPlayer **)(puVar8 + 4);
  }
  cVar2 = CTerrorPlayer::IsMotionControlledXY(pCVar6,uVar5);
  if (cVar2 == '\0') {
    uVar3 = *(uint *)(this + 0x44c);
    pCVar6 = (CTerrorPlayer *)0x0;
    if (((uVar3 != 0xffffffff) &&
        (puVar8 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar8 + 8) == uVar3 >> 0xc)) {
      pCVar6 = *(CTerrorPlayer **)(puVar8 + 4);
    }
    cVar2 = CTerrorPlayer::IsMotionControlledZ(pCVar6,uVar5);
    if (cVar2 == '\0') {
      CountdownTimer::Now();
      return *(float *)(this + 0x458) <= (float)extraout_ST0;
    }
  }
  return false;
}

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)