L L4D2node

CClaw::OnPlayerHit

0x00534de0 · 240 bytes · __thiscall

_ZN5CClaw11OnPlayerHitEP13CTerrorPlayer

Decompiled

undefined (2 params)

/* CClaw::OnPlayerHit(CTerrorPlayer*) */

void __thiscall CClaw::OnPlayerHit(CClaw *this,CTerrorPlayer *param_1)

{
  char cVar1;
  CBaseEntity *this_00;
  int iVar2;
  
  this_00 = (CBaseEntity *)CTerrorWeapon::GetPlayerOwner((CTerrorWeapon *)this);
  iVar2 = CBaseEntity::GetTeamNumber(this_00);
  if (iVar2 == 3) {
    iVar2 = (**(code **)(*(int *)this_00 + 0x544))(this_00);
    if (iVar2 == 6) {
      CBaseEntity::EmitSound(this_00,"ChargerZombie.Smash",0.0,(float *)0x0);
      CBaseEntity::EmitSound((CBaseEntity *)param_1,"ChargerZombie.Smash",0.0,(float *)0x0);
      goto LAB_00534e45;
    }
  }
  CBaseEntity::EmitSound(this_00,"Claw.HitFlesh",0.0,(float *)0x0);
  CBaseEntity::EmitSound((CBaseEntity *)param_1,"Claw.HitFlesh",0.0,(float *)0x0);
LAB_00534e45:
  iVar2 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_1);
  cVar1 = IsASurvivorTeam(iVar2);
  if (cVar1 == '\0') {
    return;
  }
  CTerrorPlayer::OnHitSurvivorWithClaw();
  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)