L L4D2node

SurvivorReviveFriend::OnInjured

0x00935b50 · 569 bytes · __cdecl

_ZN20SurvivorReviveFriend9OnInjuredEP11SurvivorBotRK15CTakeDamageInfo

Decompiled

undefined (2 params)

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

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

{
  uint uVar1;
  int *piVar2;
  code *pcVar3;
  char cVar4;
  int iVar5;
  CBaseEntity *pCVar6;
  undefined4 uVar7;
  undefined *puVar8;
  int in_GS_OFFSET;
  longdouble lVar9;
  CTerrorPlayer *in_stack_0000000c;
  int in_stack_00000010;
  CAI_Concept local_134 [8];
  CFmtStrN<256> local_12c [268];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  uVar1 = *(uint *)(in_stack_00000010 + 0x34);
  if ((((((uVar1 == 0xffffffff) ||
         (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 == (undefined *)0xfffffffc)) ||
        (*(uint *)(puVar8 + 8) != uVar1 >> 0xc)) ||
       (((*(CBaseEntity **)(puVar8 + 4) == (CBaseEntity *)0x0 ||
         (iVar5 = CBaseEntity::GetTeamNumber(*(CBaseEntity **)(puVar8 + 4)), iVar5 != 3)) ||
        ((uVar1 = *(uint *)(param_2 + 0x34), uVar1 == 0xffffffff ||
         ((puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 == (undefined *)0xfffffffc ||
          (*(uint *)(puVar8 + 8) != uVar1 >> 0xc)))))))) ||
      (piVar2 = *(int **)(puVar8 + 4), piVar2 == (int *)0x0)) ||
     ((cVar4 = (**(code **)(*piVar2 + 0x16c))(piVar2), cVar4 == '\0' ||
      (((cVar4 = (**(code **)(*piVar2 + 0x778))(piVar2), cVar4 == '\0' &&
        ((float)piVar2[0x40] < 50.0)) ||
       (lVar9 = (longdouble)CTerrorPlayer::GetProgressBarPercent(in_stack_0000000c),
       0.5 <= (float)lVar9)))))) {
    SurvivorUseObject::OnInjured(param_1,param_2);
  }
  else {
    uVar1 = *(uint *)(param_2 + 0x34);
    if (((uVar1 == 0xffffffff) ||
        (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 == (undefined *)0xfffffffc)) ||
       (*(uint *)(puVar8 + 8) != uVar1 >> 0xc)) {
      pCVar6 = (CBaseEntity *)0x0;
    }
    else {
      pCVar6 = *(CBaseEntity **)(puVar8 + 4);
    }
    uVar7 = DescribeSubject(pCVar6);
    CFmtStrN<256>::CFmtStrN(local_12c,"Subject:%s",uVar7);
    pcVar3 = *(code **)(*(int *)in_stack_0000000c + 0x7b4);
    CAI_Concept::CAI_Concept(local_134,"SurvivorBotAbandonedReviveDueToAttack");
    (*pcVar3)();
    *(undefined4 *)param_1 = 3;
    *(undefined4 *)(param_1 + 4) = 0;
    *(char **)(param_1 + 8) = "Attacked while reviving friend";
    *(undefined4 *)(param_1 + 0xc) = 2;
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  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)