L L4D2node

CTerrorPlayer::GetTimeSinceLastCombat

0x009ac620 · 285 bytes · __thiscall

_ZNK13CTerrorPlayer22GetTimeSinceLastCombatEv

Decompiled

undefined (1 param)

/* CTerrorPlayer::GetTimeSinceLastCombat() const */

longdouble __thiscall CTerrorPlayer::GetTimeSinceLastCombat(CTerrorPlayer *this)

{
  longdouble lVar1;
  longdouble lVar2;
  float fVar3;
  float fVar4;
  
  lVar1 = (longdouble)GetTimeSinceLastFiredWeapon(this);
  fVar3 = 99999.9;
  if (0.0 < *(float *)(this + 0x3128)) {
    lVar2 = (longdouble)IntervalTimer::Now();
    fVar3 = (float)lVar2 - *(float *)(this + 0x3128);
  }
  if (fVar3 < (float)lVar1) {
    lVar1 = (longdouble)GetTimeSinceLastFiredWeapon(this);
    fVar3 = (float)lVar1;
  }
  else {
    fVar3 = 99999.9;
    if (0.0 < *(float *)(this + 0x3128)) {
      lVar1 = (longdouble)IntervalTimer::Now();
      fVar3 = (float)lVar1 - *(float *)(this + 0x3128);
    }
  }
  fVar4 = 99999.9;
  if (0.0 < *(float *)(this + 0x3180)) {
    lVar1 = (longdouble)IntervalTimer::Now();
    fVar4 = (float)lVar1 - *(float *)(this + 0x3180);
  }
  if ((fVar4 <= fVar3) && (fVar3 = 99999.9, 0.0 < *(float *)(this + 0x3180))) {
    lVar1 = (longdouble)IntervalTimer::Now();
    fVar3 = (float)lVar1 - *(float *)(this + 0x3180);
  }
  return (longdouble)fVar3;
}

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)