L L4D2node

SurvivorHealSelf::OnInjured

0x00934420 · 156 bytes · __cdecl

_ZN16SurvivorHealSelf9OnInjuredEP11SurvivorBotRK15CTakeDamageInfo

Decompiled

undefined (2 params)

/* SurvivorHealSelf::OnInjured(SurvivorBot*, CTakeDamageInfo const&) */

SurvivorBot * SurvivorHealSelf::OnInjured(SurvivorBot *param_1,CTakeDamageInfo *param_2)

{
  uint uVar1;
  char cVar2;
  int iVar3;
  undefined *puVar4;
  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)) &&
     (*(CBaseEntity **)(puVar4 + 4) != (CBaseEntity *)0x0)) {
    iVar3 = CBaseEntity::GetTeamNumber(*(CBaseEntity **)(puVar4 + 4));
    cVar2 = IsASurvivorTeam(iVar3);
    if (cVar2 != '\0') {
      *(undefined4 *)param_1 = 0;
      *(undefined4 *)(param_1 + 4) = 0;
      *(undefined4 *)(param_1 + 8) = 0;
      *(undefined4 *)(param_1 + 0xc) = 1;
      return param_1;
    }
  }
  *(undefined4 *)param_1 = 3;
  *(undefined4 *)(param_1 + 4) = 0;
  *(char **)(param_1 + 8) = "Injured while healing myself";
  *(undefined4 *)(param_1 + 0xc) = 3;
  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)