L L4D2node

CBaseCombatCharacter::GetTimeSinceLastInjury

0x005f0e90 · 269 bytes · __thiscall

_ZNK20CBaseCombatCharacter22GetTimeSinceLastInjuryEi

Decompiled

undefined (2 params)

/* CBaseCombatCharacter::GetTimeSinceLastInjury(int) const */

longdouble __thiscall
CBaseCombatCharacter::GetTimeSinceLastInjury(CBaseCombatCharacter *this,int param_1)

{
  int iVar1;
  CBaseCombatCharacter *pCVar2;
  longdouble lVar3;
  float fVar4;
  float fVar5;
  
  iVar1 = 0;
  pCVar2 = this;
  if (param_1 == -1) {
    fVar5 = 1e+12;
    pCVar2 = this + 0x19e8;
    iVar1 = 4;
    do {
      if (*(int *)(pCVar2 + -4) != -1) {
        fVar4 = 99999.9;
        if (0.0 < *(float *)(pCVar2 + 4)) {
          lVar3 = (longdouble)IntervalTimer::Now();
          fVar4 = (float)lVar3 - *(float *)(pCVar2 + 4);
        }
        if (fVar4 < fVar5) {
          fVar5 = 99999.9;
          if (0.0 < *(float *)(pCVar2 + 4)) {
            lVar3 = (longdouble)IntervalTimer::Now();
            fVar5 = (float)lVar3 - *(float *)(pCVar2 + 4);
          }
        }
      }
      pCVar2 = pCVar2 + 0xc;
      iVar1 = iVar1 + -1;
    } while (iVar1 != 0);
    return (longdouble)fVar5;
  }
  do {
    if (*(int *)(pCVar2 + 0x19e4) == param_1) {
      fVar5 = 99999.9;
      if (0.0 < *(float *)(this + iVar1 * 0xc + 0x19ec)) {
        lVar3 = (longdouble)IntervalTimer::Now();
        fVar5 = (float)lVar3 - *(float *)(this + iVar1 * 0xc + 0x19ec);
      }
      goto LAB_005f0ec6;
    }
    iVar1 = iVar1 + 1;
    pCVar2 = pCVar2 + 0xc;
  } while (iVar1 != 4);
  fVar5 = 1e+12;
LAB_005f0ec6:
  return (longdouble)fVar5;
}

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)