L L4D2node

CTerrorPlayer::IsInCombat

0x009ac470 · 413 bytes · __thiscall

_ZNK13CTerrorPlayer10IsInCombatEb

Decompiled

undefined (2 params)

/* CTerrorPlayer::IsInCombat(bool) const */

bool __thiscall CTerrorPlayer::IsInCombat(CTerrorPlayer *this,bool param_1)

{
  uint uVar1;
  undefined *puVar2;
  longdouble lVar3;
  longdouble extraout_ST0;
  longdouble extraout_ST0_00;
  
  uVar1 = *(uint *)(this + 0x3ee0);
  if ((((uVar1 != 0xffffffff) &&
       (puVar2 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar2 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar2 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar2 + 4) != 0)) {
    return true;
  }
  if (param_1) {
    lVar3 = (longdouble)GetTimeSinceLastFiredWeapon(this);
    if ((((float)lVar3 < 1.5) && (0.0 < *(float *)(this + 0x3128))) &&
       (lVar3 = (longdouble)IntervalTimer::Now(), (float)lVar3 - *(float *)(this + 0x3128) < 3.0)) {
      return true;
    }
    if (0.0 < *(float *)(this + 0x3180)) {
      IntervalTimer::Now();
      return (float)extraout_ST0_00 - *(float *)(this + 0x3180) < 1.5;
    }
  }
  else {
    lVar3 = (longdouble)GetTimeSinceLastFiredWeapon(this);
    if ((((float)lVar3 < 3.0) && (0.0 < *(float *)(this + 0x3128))) &&
       (lVar3 = (longdouble)IntervalTimer::Now(), (float)lVar3 - *(float *)(this + 0x3128) < 6.0)) {
      return true;
    }
    if (0.0 < *(float *)(this + 0x3180)) {
      IntervalTimer::Now();
      return (float)extraout_ST0 - *(float *)(this + 0x3180) < 3.0;
    }
  }
  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)