L L4D2node

CTerrorPlayer::OnMeleeAttack

0x009c1470 · 326 bytes · __thiscall

_ZN13CTerrorPlayer13OnMeleeAttackEv

Decompiled

undefined (1 param)

/* CTerrorPlayer::OnMeleeAttack() */

void __thiscall CTerrorPlayer::OnMeleeAttack(CTerrorPlayer *this)

{
  code *pcVar1;
  CWeaponCSBase *this_00;
  int iVar2;
  undefined4 uVar3;
  int in_GS_OFFSET;
  longdouble lVar4;
  CAI_Concept local_134 [8];
  CFmtStrN<256> local_12c [5];
  undefined1 local_127 [263];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  lVar4 = (longdouble)IntervalTimer::Now();
  if ((float)lVar4 != *(float *)(this + 0x3164)) {
    (**(code **)(*(int *)(this + 0x3160) + 4))(this + 0x3160,this + 0x3164);
    *(float *)(this + 0x3164) = (float)lVar4;
  }
  if (*(int *)(this + 0x1fe4) != 0) {
    *(undefined4 *)(this + 0x298c) = *(undefined4 *)(*(int *)(this + 0x1fe4) + 4);
  }
  this[0x3ab9] = (CTerrorPlayer)0x1;
  this_00 = (CWeaponCSBase *)GetActiveTerrorWeapon(this);
  if (this_00 != (CWeaponCSBase *)0x0) {
    iVar2 = CWeaponCSBase::GetCSWpnData(this_00);
    if (*(int *)(iVar2 + 0x894) - 8U < 2) {
      uVar3 = (**(code **)(*(int *)this_00 + 0x6c8))(this_00);
      CFmtStrN<256>::CFmtStrN(local_12c,"Item:%s",uVar3);
      pcVar1 = *(code **)(*(int *)this + 0x7b4);
      CAI_Concept::CAI_Concept(local_134,"BashWithItem");
      (*pcVar1)(this,local_134,1,local_127,0,0,0);
    }
  }
  StopDragging(this);
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)