L L4D2node

CCollisionEvent::AddDamageEvent

0x0077fdc0 · 497 bytes · __thiscall

_ZN15CCollisionEvent14AddDamageEventEP11CBaseEntityRK15CTakeDamageInfoP14IPhysicsObjectbRK6VectorS9_.part.180

Decompiled

undefined (7 params)

/* CCollisionEvent::AddDamageEvent(CBaseEntity*, CTakeDamageInfo const&, IPhysicsObject*, bool,
   Vector const&, Vector const&) [clone .part.180] */

void __thiscall
CCollisionEvent::AddDamageEvent
          (CCollisionEvent *this,CBaseEntity *param_1,CTakeDamageInfo *param_2,
          IPhysicsObject *param_3,bool param_4,Vector *param_5,Vector *param_6)

{
  float fVar1;
  int iVar2;
  char cVar3;
  CCollisionEvent *in_EAX;
  int iVar4;
  int *in_ECX;
  int in_EDX;
  int *piVar5;
  int iVar6;
  longdouble lVar7;
  undefined1 local_24;
  
  (**(code **)(*g_pGameRules + 0x58))(g_pGameRules);
  iVar4 = CUtlVector<damageevent_t,CUtlMemory<damageevent_t,int>>::InsertBefore
                    ((CUtlVector<damageevent_t,CUtlMemory<damageevent_t,int>> *)(in_EAX + 0xf8),
                     *(int *)(in_EAX + 0x104));
  piVar5 = (int *)(iVar4 * 0x6c + *(int *)(in_EAX + 0xf8));
  *piVar5 = in_EDX;
  piVar5[2] = *in_ECX;
  piVar5[3] = in_ECX[1];
  piVar5[4] = in_ECX[2];
  piVar5[5] = in_ECX[3];
  piVar5[6] = in_ECX[4];
  piVar5[7] = in_ECX[5];
  piVar5[8] = in_ECX[6];
  piVar5[9] = in_ECX[7];
  piVar5[10] = in_ECX[8];
  piVar5[0xb] = in_ECX[9];
  piVar5[0xc] = in_ECX[10];
  piVar5[0xd] = in_ECX[0xb];
  piVar5[0xe] = in_ECX[0xc];
  piVar5[0xf] = in_ECX[0xd];
  piVar5[0x10] = in_ECX[0xe];
  piVar5[0x11] = in_ECX[0xf];
  piVar5[0x12] = in_ECX[0x10];
  piVar5[0x13] = in_ECX[0x11];
  piVar5[0x14] = in_ECX[0x12];
  piVar5[0x15] = in_ECX[0x13];
  piVar5[0x16] = in_ECX[0x14];
  piVar5[0x17] = in_ECX[0x15];
  piVar5[0x18] = in_ECX[0x16];
  iVar4 = in_ECX[0x17];
  piVar5[1] = (int)this;
  piVar5[0x19] = iVar4;
  local_24 = SUB41(param_1,0);
  *(undefined1 *)(piVar5 + 0x1a) = local_24;
  if ((this == (CCollisionEvent *)0x0) ||
     (cVar3 = (**(code **)(*(int *)this + 0x2c))(this), cVar3 == '\0')) {
    *(undefined1 *)(piVar5 + 0x1a) = 0;
    return;
  }
  if ((char)piVar5[0x1a] == '\0') {
    return;
  }
  lVar7 = (longdouble)(**(code **)(**(int **)(in_EDX + 0x238) + 0x78))(*(int **)(in_EDX + 0x238));
  fVar1 = (float)lVar7;
  iVar4 = *(int *)(in_EAX + 0x118) + -1;
  if (-1 < iVar4) {
    iVar6 = *(int *)(in_EAX + 0x10c) + iVar4 * 0x24;
    if (this != *(CCollisionEvent **)(iVar6 + 0x18)) {
      iVar2 = *(int *)(in_EAX + 0x10c) + -0x24 + iVar4 * 0x24;
      do {
        iVar6 = iVar2;
        iVar4 = iVar4 + -1;
        if (iVar4 == -1) goto LAB_0077ff62;
        iVar2 = iVar6 + -0x24;
      } while (this != *(CCollisionEvent **)(iVar6 + 0x18));
    }
    if (fVar1 < *(float *)(iVar6 + 0x1c) || fVar1 == *(float *)(iVar6 + 0x1c)) {
      return;
    }
    *(float *)(iVar6 + 0x1c) = fVar1;
    return;
  }
LAB_0077ff62:
  AddDamageInflictor(in_EAX,(IPhysicsObject *)this,fVar1,(Vector *)param_2,(Vector *)param_3,true);
  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)