L L4D2node

SurvivorBot::MaintainWeaponry

0x0093a5c0 · 248 bytes · __thiscall

_ZN11SurvivorBot16MaintainWeaponryEv

Decompiled

undefined (1 param)

/* SurvivorBot::MaintainWeaponry() */

void __thiscall SurvivorBot::MaintainWeaponry(SurvivorBot *this)

{
  char cVar1;
  int iVar2;
  longdouble lVar3;
  
  cVar1 = (**(code **)(*(int *)this + 0x908))(this,3);
  if (((cVar1 != '\0') &&
      (lVar3 = (longdouble)CTerrorPlayer::GetTimeSinceLastFiredWeapon((CTerrorPlayer *)this),
      1.0 < (float)lVar3)) &&
     ((iVar2 = CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this), iVar2 == 0 ||
      (*(char *)(iVar2 + 0x1459) == '\0')))) {
    (**(code **)(*(int *)this + 0x950))(this,0xbf800000);
  }
  cVar1 = IsAvailable(this);
  if ((cVar1 != '\0') &&
     (lVar3 = (longdouble)CTerrorPlayer::GetTimeSinceLastFiredWeapon((CTerrorPlayer *)this),
     5.0 < (float)lVar3)) {
    if ((0.0 < *(float *)(this + 0x1ab98)) &&
       (lVar3 = (longdouble)IntervalTimer::Now(), (float)lVar3 - *(float *)(this + 0x1ab98) <= 5.0))
    {
      return;
    }
    iVar2 = CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
    if ((iVar2 == 0) || (*(char *)(iVar2 + 0x1459) == '\0')) {
      (**(code **)(*(int *)this + 0x950))(this,0xbf800000);
      return;
    }
  }
  return;
}

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)