L L4D2node

SurvivorLiberateBesiegedFriend::OnInjured

0x0091d8a0 · 297 bytes · __thiscall

_ZN30SurvivorLiberateBesiegedFriend9OnInjuredEP11SurvivorBotRK15CTakeDamageInfo

Decompiled

undefined (3 params)

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

SurvivorLiberateBesiegedFriend * __thiscall
SurvivorLiberateBesiegedFriend::OnInjured
          (SurvivorLiberateBesiegedFriend *this,SurvivorBot *param_1,CTakeDamageInfo *param_2)

{
  int iVar1;
  char cVar2;
  int *piVar3;
  undefined4 *puVar4;
  longdouble lVar5;
  
  iVar1 = *(int *)(param_2 + 0x100);
  lVar5 = (longdouble)(**(code **)(*(int *)param_2 + 0x7e4))(param_2);
  if (50.0 <= (float)lVar5 + (float)iVar1) {
    piVar3 = (int *)(**(code **)(*(int *)param_2 + 0x9a0))(param_2);
    cVar2 = (**(code **)(*piVar3 + 0x114))(piVar3);
    if (cVar2 == '\0') {
      *(undefined4 *)this = 4;
      *(undefined4 *)(this + 4) = 0;
      *(undefined4 *)(this + 8) = 0;
      *(undefined4 *)(this + 0xc) = 1;
      return this;
    }
    puVar4 = ::operator_new(0x34);
    *(undefined4 *)this = 2;
    puVar4[8] = 0;
    puVar4[9] = 0;
    puVar4[10] = 0;
    puVar4[3] = 0;
    puVar4[4] = 0;
    puVar4[5] = 0;
    puVar4[6] = 0;
    puVar4[7] = 0;
    puVar4[2] = 0;
    *(undefined1 *)(puVar4 + 0xc) = 0;
    *(undefined1 *)((int)puVar4 + 0x31) = 0;
    puVar4[0xb] = 0;
    *puVar4 = &PTR__SurvivorEscapeLadderAmbush_00d01348;
    puVar4[1] = &PTR__SurvivorEscapeLadderAmbush_00d014ac;
    *(undefined4 **)(this + 4) = puVar4;
    *(char **)(this + 8) = "I\'m being attacked while helpless on a ladder!";
    *(undefined4 *)(this + 0xc) = 3;
  }
  else {
    *(undefined4 *)this = 3;
    *(undefined4 *)(this + 4) = 0;
    *(char **)(this + 8) = "Ouch! I have to defend myself!";
    *(undefined4 *)(this + 0xc) = 2;
  }
  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)