L L4D2node

CTerrorPlayer::OnWeaponFired

0x009d93f0 · 247 bytes · __thiscall

_ZN13CTerrorPlayer13OnWeaponFiredEv

Decompiled

undefined (1 param)

/* CTerrorPlayer::OnWeaponFired() */

void __thiscall CTerrorPlayer::OnWeaponFired(CTerrorPlayer *this)

{
  uint uVar1;
  undefined *puVar2;
  longdouble lVar3;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  
  uVar1 = *(uint *)(this + 0x1d14);
  if ((((uVar1 == 0xffffffff) ||
       (puVar2 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar2 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar2 + 8) != uVar1 >> 0xc)) || (*(int *)(puVar2 + 4) == 0)) {
    CCSPlayer::OnWeaponFired((CCSPlayer *)this);
  }
  *(undefined4 *)(this + 0x3154) = *(undefined4 *)(this + 0x3150);
  lVar3 = (longdouble)IntervalTimer::Now();
  if ((float)lVar3 != *(float *)(this + 0x3150)) {
    (**(code **)(*(int *)(this + 0x314c) + 4))(this + 0x314c,this + 0x3150);
    *(float *)(this + 0x3150) = (float)lVar3;
  }
  if (((byte)this[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
  }
  local_18 = *(undefined4 *)(this + 0x2e0);
  local_14 = *(undefined4 *)(this + 0x2e4);
  local_10 = *(undefined4 *)(this + 0x2e8);
  ForEachTerrorPlayer<NearbyCalmInhibitor>((NearbyCalmInhibitor *)&local_18);
  this[0x3ab9] = (CTerrorPlayer)0x1;
  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)