L L4D2node

CBaseEntity::SendOnKilledGameEvent

0x00605740 · 373 bytes · __thiscall

_ZN11CBaseEntity21SendOnKilledGameEventERK15CTakeDamageInfo

Decompiled

undefined (2 params)

/* CBaseEntity::SendOnKilledGameEvent(CTakeDamageInfo const&) */

void __thiscall CBaseEntity::SendOnKilledGameEvent(CBaseEntity *this,CTakeDamageInfo *param_1)

{
  uint uVar1;
  int *piVar2;
  int iVar3;
  undefined *puVar4;
  
  piVar2 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"entity_killed",0,0);
  if (piVar2 != (int *)0x0) {
    if (*(int *)(this + 0x30) == 0) {
      iVar3 = 0;
    }
    else {
      iVar3 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
    }
    (**(code **)(*piVar2 + 0x30))(piVar2,"entindex_killed",iVar3);
    uVar1 = *(uint *)(param_1 + 0x34);
    if ((((uVar1 != 0xffffffff) &&
         (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
        (*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar4 + 4) != 0)) {
      iVar3 = *(int *)(*(int *)(puVar4 + 4) + 0x30);
      if (iVar3 == 0) {
        iVar3 = 0;
      }
      else {
        iVar3 = iVar3 - *(int *)(gpGlobals + 0x58) >> 4;
      }
      (**(code **)(*piVar2 + 0x30))(piVar2,"entindex_attacker",iVar3);
    }
    uVar1 = *(uint *)(param_1 + 0x30);
    if (((uVar1 != 0xffffffff) &&
        (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
       ((*(uint *)(puVar4 + 8) == uVar1 >> 0xc && (*(int *)(puVar4 + 4) != 0)))) {
      iVar3 = *(int *)(*(int *)(puVar4 + 4) + 0x30);
      if (iVar3 == 0) {
        iVar3 = 0;
      }
      else {
        iVar3 = iVar3 - *(int *)(gpGlobals + 0x58) >> 4;
      }
      (**(code **)(*piVar2 + 0x30))(piVar2,"entindex_inflictor",iVar3);
    }
    (**(code **)(*piVar2 + 0x30))(piVar2,"damagebits",*(undefined4 *)(param_1 + 0x48));
    (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar2,0);
  }
  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)