L L4D2node

CVomit::OnStunned

0x004e4eb0 · 504 bytes · __cdecl

_ZN6CVomit9OnStunnedEf

Decompiled

undefined (1 param)

/* CVomit::OnStunned(float) */

void CVomit::OnStunned(float param_1)

{
  uint uVar1;
  CBaseEntity *this;
  CBaseEdict *pCVar2;
  int iVar3;
  undefined *puVar4;
  CBaseEntity *pCVar5;
  
  uVar1 = *(uint *)((int)param_1 + 0x44c);
  if ((((uVar1 == 0xffffffff) ||
       (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar4 + 8) != uVar1 >> 0xc)) ||
     (this = *(CBaseEntity **)(puVar4 + 4), this == (CBaseEntity *)0x0)) {
    return;
  }
  if (*(char *)((int)param_1 + 0x45d) == '\0') {
                    /* WARNING: Could not recover jumptable at 0x004e5006. Too many branches */
                    /* WARNING: Treating indirect jump as call */
    (**(code **)(*(int *)param_1 + 0x340))();
    return;
  }
  if (*(float *)(this + 0x2848) != 0.0) {
    if (this[0x6c] == (CBaseEntity)0x0) {
      pCVar2 = *(CBaseEdict **)(this + 0x30);
      if (pCVar2 != (CBaseEdict *)0x0) {
        *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
        *(undefined2 *)(iVar3 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CBaseEntity)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x2848) = 0;
    if (*(char *)((int)param_1 + 0x45d) == '\0') goto LAB_004e4f48;
  }
  if (*(char *)((int)param_1 + 0x6c) == '\0') {
    pCVar2 = *(CBaseEdict **)((int)param_1 + 0x30);
    if (pCVar2 != (CBaseEdict *)0x0) {
      *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
      iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
      *(undefined2 *)(iVar3 + 2) = 0;
    }
  }
  else {
    *(byte *)((int)param_1 + 0x70) = *(byte *)((int)param_1 + 0x70) | 1;
  }
  *(undefined1 *)((int)param_1 + 0x45d) = 0;
LAB_004e4f48:
  StopVomitEffect((CVomit *)param_1);
  if (*(float *)((int)param_1 + 0x474) != -1.0) {
    (**(code **)(*(int *)((int)param_1 + 0x46c) + 4))((int)param_1 + 0x46c,(int)param_1 + 0x474);
    *(undefined4 *)((int)param_1 + 0x474) = 0xbf800000;
  }
  if (*(float *)((int)param_1 + 0x468) != -1.0) {
    (**(code **)(*(int *)((int)param_1 + 0x460) + 4))((int)param_1 + 0x460,(int)param_1 + 0x468);
    *(undefined4 *)((int)param_1 + 0x468) = 0xbf800000;
  }
  pCVar5 = (CBaseEntity *)0x0;
  CBaseAbility::StartActivationTimer
            ((CBaseAbility *)param_1,*(float *)(ZombieVomitInterval._28_4_ + 0x2c),0.0);
  CBaseEntity::EmitSound(this,"Vomit.Cancel",0.0,(float *)0x0);
  while (pCVar5 = (CBaseEntity *)
                  CGlobalEntityList::FindEntityByClassname
                            ((CGlobalEntityList *)gEntList,pCVar5,"vomit_particle"),
        pCVar5 != (CBaseEntity *)0x0) {
    UTIL_Remove(pCVar5);
  }
  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)