L L4D2node

CItemDefibrillator::Operator_HandleAnimEvent

0x00541b50 · 236 bytes · __thiscall

_ZN18CItemDefibrillator24Operator_HandleAnimEventEP11animevent_tP20CBaseCombatCharacter

Decompiled

undefined (3 params)

/* CItemDefibrillator::Operator_HandleAnimEvent(animevent_t*, CBaseCombatCharacter*) */

void __thiscall
CItemDefibrillator::Operator_HandleAnimEvent
          (CItemDefibrillator *this,animevent_t *param_1,CBaseCombatCharacter *param_2)

{
  int iVar1;
  char cVar2;
  int *piVar3;
  int iVar4;
  undefined4 local_20 [3];
  undefined4 local_14;
  undefined4 local_10;
  
  iVar4 = IPredictionSystem::g_pPredictionSystems;
  iVar1 = IPredictionSystem::g_pPredictionSystems;
  if (*(int *)param_1 == 0x49) {
    for (; iVar1 != 0; iVar1 = *(int *)(iVar1 + 4)) {
      *(int *)(iVar1 + 0x10) = *(int *)(iVar1 + 0x10) + 1;
    }
                    /* try { // try from 00541ba8 to 00541c21 has its CatchHandler @ 00541c41 */
    if ((param_2 != (CBaseCombatCharacter *)0x0) &&
       (cVar2 = (**(code **)(*(int *)param_2 + 0x16c))(param_2),
       iVar4 = IPredictionSystem::g_pPredictionSystems, cVar2 != '\0')) {
      CBaseEntity::EmitSound((CBaseEntity *)param_2,"Defibrillator.Use",0.0,(float *)0x0);
      piVar3 = (int *)CTerrorPlayer::GetEntityIAmPerformingActionOn((CTerrorPlayer *)param_2);
      iVar4 = IPredictionSystem::g_pPredictionSystems;
      if (piVar3 != (int *)0x0) {
        local_20[0] = 0;
        local_14 = 0xffffffff;
        local_10 = 0;
        (**(code **)(*piVar3 + 0xb4))(piVar3,"Shock",this,this,local_20,0);
        iVar4 = IPredictionSystem::g_pPredictionSystems;
      }
    }
    if (iVar4 != 0) {
      do {
        *(int *)(iVar4 + 0x10) = *(int *)(iVar4 + 0x10) + -1;
        iVar4 = *(int *)(iVar4 + 4);
      } while (iVar4 != 0);
      return;
    }
  }
  else {
    CTerrorWeapon::Operator_HandleAnimEvent((animevent_t *)this,(CBaseCombatCharacter *)param_1);
  }
  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)