L L4D2node

PunchVictim::OnStart

0x00a28c30 · 263 bytes · __thiscall

_ZN11PunchVictim7OnStartEP8InfectedP6ActionIS0_E

Decompiled

undefined (3 params)

/* PunchVictim::OnStart(Infected*, Action<Infected>*) */

PunchVictim * __thiscall PunchVictim::OnStart(PunchVictim *this,Infected *param_1,Action *param_2)

{
  uint uVar1;
  undefined *puVar2;
  Action *pAVar3;
  longdouble lVar4;
  CTakeDamageInfo local_7c [108];
  
  if (*(int *)(ZombieDestroyOnAttack._28_4_ + 0x30) == 1) {
    UTIL_Remove((CBaseEntity *)param_2);
  }
  else if (*(int *)(ZombieDestroyOnAttack._28_4_ + 0x30) == 2) {
    uVar1 = *(uint *)(param_1 + 0x58);
    pAVar3 = param_2;
    if ((((uVar1 != 0xffffffff) &&
         (puVar2 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar2 != (undefined *)0xfffffffc)) &&
        (*(uint *)(puVar2 + 8) == uVar1 >> 0xc)) &&
       (pAVar3 = (Action *)*(CBaseEntity **)(puVar2 + 4),
       *(CBaseEntity **)(puVar2 + 4) == (CBaseEntity *)0x0)) {
      pAVar3 = param_2;
    }
    CTakeDamageInfo::CTakeDamageInfo
              (local_7c,(CBaseEntity *)pAVar3,(CBaseEntity *)pAVar3,1000.0,2,0);
    CBaseEntity::TakeDamage((CBaseEntity *)param_2,local_7c);
  }
  lVar4 = (longdouble)IntervalTimer::Now();
  if ((float)lVar4 != *(float *)(param_1 + 0x48)) {
    (**(code **)(*(int *)(param_1 + 0x44) + 4))(param_1 + 0x44,param_1 + 0x48);
    *(float *)(param_1 + 0x48) = (float)lVar4;
  }
  *(undefined4 *)this = 0;
  *(undefined4 *)(this + 4) = 0;
  *(undefined4 *)(this + 8) = 0;
  return this;
}

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)