L L4D2node

CBasePlayer::Event_Killed

0x007be100 · 685 bytes · __thiscall

_ZN11CBasePlayer12Event_KilledERK15CTakeDamageInfo

Decompiled

undefined (2 params)

/* CBasePlayer::Event_Killed(CTakeDamageInfo const&) */

void __thiscall CBasePlayer::Event_Killed(CBasePlayer *this,CTakeDamageInfo *param_1)

{
  float fVar1;
  code *pcVar2;
  CBaseEdict *this_00;
  int iVar3;
  CHintSystem *this_01;
  CSound *this_02;
  int *piVar4;
  
  iVar3 = (**(code **)(*(int *)this + 0x74c))(this);
  if (iVar3 != 0) {
    this_01 = (CHintSystem *)(**(code **)(*(int *)this + 0x74c))(this);
    CHintSystem::ResetHintTimers(this_01);
  }
  (**(code **)(*g_pGameRules + 0x138))(g_pGameRules,this,param_1);
  (**(code **)(*(int *)gamestats + 0x4c))(gamestats,this,param_1);
  RumbleEffect(this,'\0','\0','\0');
  ClearUseEntity(this);
  iVar3 = CSoundEnt::ClientSoundIndex(*(edict_t **)(this + 0x30));
  this_02 = (CSound *)CSoundEnt::SoundPointerForIndex(iVar3);
  if (this_02 != (CSound *)0x0) {
    CSound::Reset(this_02);
  }
  if (*(int *)(this + 0x100) < -99) {
    (**(code **)(*(int *)this + 0x214))(this,this + 0x100);
    *(undefined4 *)(this + 0x100) = 0;
  }
  iVar3 = CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
  if (iVar3 != 0) {
    piVar4 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
    (**(code **)(*piVar4 + 0x428))(piVar4,0);
  }
  (**(code **)(*(int *)this + 0x620))(this,4);
  pcVar2 = *(code **)(*(int *)this + 0x254);
  iVar3 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
  (*pcVar2)(this,iVar3 + 0x60);
  if (this[0x104] != (CBasePlayer)0x1) {
    (**(code **)(*(int *)this + 0x21c))(this,this + 0x104);
    this[0x104] = (CBasePlayer)0x1;
  }
  if (this[0x1c80] != (CBasePlayer)0x1) {
    (**(code **)(*(int *)(this + 0x1c7c) + 4))(this + 0x1c7c,this + 0x1c80);
    this[0x1c80] = (CBasePlayer)0x1;
  }
  CCollisionProperty::SetSolidFlags
            ((CCollisionProperty *)(this + 0x194),(uint)(*(ushort *)(this + 0x1b4) | 4));
  piVar4 = *(int **)(this + 0x238);
  if (piVar4 != (int *)0x0) {
    (**(code **)(*piVar4 + 0x70))(piVar4);
  }
  CBaseEntity::SetMoveType((CBaseEntity *)this,5,0);
  CBaseEntity::SetGroundEntity((CBaseEntity *)this,(CBaseEntity *)0x0);
  SetSuitUpdate(this,(char *)0x0,0,0);
  SetFOV(this,(CBaseEntity *)this,0,0.0,0);
  iVar3 = (**(code **)(*(int *)this + 0x5f4))(this);
  if (iVar3 != 0) {
    (**(code **)(*(int *)this + 0x5fc))(this,0);
  }
  fVar1 = *(float *)(gpGlobals + 0xc);
  if (fVar1 != *(float *)(this + 0x1d5c)) {
    if (this[0x6c] == (CBasePlayer)0x0) {
      this_00 = *(CBaseEdict **)(this + 0x30);
      if (this_00 != (CBaseEdict *)0x0) {
        *(uint *)this_00 = *(uint *)this_00 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(this_00);
        *(undefined2 *)(iVar3 + 2) = 0;
      }
      *(float *)(this + 0x1d5c) = fVar1;
    }
    else {
      this[0x70] = (CBasePlayer)((byte)this[0x70] | 1);
      *(float *)(this + 0x1d5c) = fVar1;
    }
  }
  (**(code **)(*(int *)this + 0x534))(this);
  CBaseCombatCharacter::Event_Killed((CBaseCombatCharacter *)this,param_1);
  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)