L L4D2node

InfectedAlert::OnInjured

0x00a191c0 · 351 bytes · __cdecl

_ZN13InfectedAlert9OnInjuredEP8InfectedRK15CTakeDamageInfo

Decompiled

undefined (2 params)

/* InfectedAlert::OnInjured(Infected*, CTakeDamageInfo const&) */

Infected * InfectedAlert::OnInjured(Infected *param_1,CTakeDamageInfo *param_2)

{
  uint uVar1;
  int *piVar2;
  CBaseEntity *pCVar3;
  InfectedAttack *this;
  undefined *puVar4;
  int in_stack_0000000c;
  int in_stack_00000010;
  
  uVar1 = *(uint *)(in_stack_00000010 + 0x34);
  if ((((uVar1 != 0xffffffff) &&
       (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar4 + 4) != 0)) {
    piVar2 = (int *)__dynamic_cast(*(int *)(puVar4 + 4),&CBaseEntity::typeinfo,&INextBot::typeinfo,
                                   0xfffffffe);
    if (piVar2 == (int *)0x0) {
      if ((*(byte *)(in_stack_0000000c + 0x1c75) & 4) == 0) goto LAB_00a191f9;
      this = ::operator_new(0x481c);
      *(undefined4 *)(this + 0x20) = 0;
      *(undefined4 *)(this + 0x24) = 0;
      *(undefined4 *)(this + 0x28) = 0;
      *(undefined4 *)(this + 0xc) = 0;
      *(undefined4 *)(this + 0x10) = 0;
      *(undefined4 *)(this + 0x14) = 0;
      *(undefined4 *)(this + 0x18) = 0;
      *(undefined4 *)(this + 0x1c) = 0;
      *(undefined4 *)(this + 8) = 0;
      this[0x30] = (InfectedAttack)0x0;
      this[0x31] = (InfectedAttack)0x0;
      *(undefined4 *)(this + 0x2c) = 0;
      *(undefined ***)this = &PTR__InfectedFlee_00d240a8;
      *(undefined ***)(this + 4) = &PTR__InfectedFlee_00d2420c;
                    /* try { // try from 00a19318 to 00a1931c has its CatchHandler @ 00a19334 */
      PathFollower::PathFollower((PathFollower *)(this + 0x34));
    }
    else {
      pCVar3 = (CBaseEntity *)(**(code **)(*piVar2 + 0xb4))(piVar2);
      this = ::operator_new(0x48);
                    /* try { // try from 00a1926d to 00a19271 has its CatchHandler @ 00a19322 */
      InfectedAttack::InfectedAttack(this,pCVar3);
    }
    *(undefined4 *)param_1 = 1;
    *(InfectedAttack **)(param_1 + 4) = this;
    *(undefined4 *)(param_1 + 8) = 0;
    *(undefined4 *)(param_1 + 0xc) = 1;
    return param_1;
  }
LAB_00a191f9:
  *(undefined4 *)param_1 = 0;
  *(undefined4 *)(param_1 + 4) = 0;
  *(undefined4 *)(param_1 + 8) = 0;
  *(undefined4 *)(param_1 + 0xc) = 1;
  return param_1;
}

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)