L L4D2node

CItemDefibrillator::OnActionComplete

0x005419d0 · 310 bytes · __thiscall

_ZN18CItemDefibrillator16OnActionCompleteEP13CTerrorPlayerP11CBaseEntity

Decompiled

undefined (3 params)

/* CItemDefibrillator::OnActionComplete(CTerrorPlayer*, CBaseEntity*) */

void __thiscall
CItemDefibrillator::OnActionComplete
          (CItemDefibrillator *this,CTerrorPlayer *param_1,CBaseEntity *param_2)

{
  code *pcVar1;
  CSurvivorDeathModel *pCVar2;
  CTerrorPlayer *this_00;
  int *piVar3;
  undefined4 uVar4;
  
  if (param_2 != (CBaseEntity *)0x0) {
    pCVar2 = (CSurvivorDeathModel *)
             __dynamic_cast(param_2,&CBaseEntity::typeinfo,&CSurvivorDeathModel::typeinfo,0);
    if (pCVar2 != (CSurvivorDeathModel *)0x0) {
      this_00 = (CTerrorPlayer *)
                CTerrorPlayer::GetPlayerByCharacter(*(undefined4 *)(pCVar2 + 0x17d8));
      if (this_00 != (CTerrorPlayer *)0x0) {
        CTerrorPlayer::OnRevivedByDefibrillator(this_00,param_1,pCVar2);
        CBasePlayer::RumbleEffect((CBasePlayer *)param_1,'!','\0','\x04');
        piVar3 = (int *)(**(code **)(*gameeventmanager + 0x1c))
                                  (gameeventmanager,"defibrillator_used",0,0);
        if (piVar3 != (int *)0x0) {
          pcVar1 = *(code **)(*piVar3 + 0x30);
          uVar4 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(param_1 + 0x30));
          (*pcVar1)(piVar3,"userid",uVar4);
          pcVar1 = *(code **)(*piVar3 + 0x30);
          uVar4 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this_00 + 0x30));
          (*pcVar1)(piVar3,"subject",uVar4);
                    /* WARNING: Could not recover jumptable at 0x00541afc. Too many branches */
                    /* WARNING: Treating indirect jump as call */
          (**(code **)(*gameeventmanager + 0x20))();
          return;
        }
      }
    }
  }
  return;
}

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)