L L4D2node

CTerrorPlayer::OnHitByVomitJar

0x009b84d0 · 1110 bytes · __thiscall

_ZN13CTerrorPlayer15OnHitByVomitJarEP20CBaseCombatCharacter

Decompiled

undefined (2 params)

/* CTerrorPlayer::OnHitByVomitJar(CBaseCombatCharacter*) */

void __thiscall CTerrorPlayer::OnHitByVomitJar(CTerrorPlayer *this,CBaseCombatCharacter *param_1)

{
  CBaseEdict *pCVar1;
  char cVar2;
  int iVar3;
  undefined4 *puVar4;
  NextBotManager *this_00;
  longdouble lVar5;
  float fVar6;
  float fVar7;
  float local_20;
  MobAlert local_19;
  float local_18;
  float local_14;
  undefined4 local_10;
  
  cVar2 = IsInCommentaryMode();
  if ((cVar2 != '\0') && (cVar2 = (**(code **)(*(int *)this + 0x778))(this), cVar2 == '\0')) {
    return;
  }
  iVar3 = gpGlobals;
  fVar6 = *(float *)(this + 0x3f18);
  if (fVar6 == 0.0) {
    fVar7 = *(float *)(gpGlobals + 0xc);
joined_r0x009b8679:
    if (fVar6 != fVar7) {
      if (this[0x6c] == (CTerrorPlayer)0x0) {
        pCVar1 = *(CBaseEdict **)(this + 0x30);
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar3 + 2) = 0;
          iVar3 = gpGlobals;
        }
      }
      else {
        this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
      }
      *(float *)(this + 0x3f18) = fVar7;
      fVar6 = *(float *)(iVar3 + 0xc);
    }
    fVar6 = fVar6 + *(float *)(ZombieVomitFadeStart._28_4_ + 0x2c);
    if (fVar6 == *(float *)(this + 0x3f1c)) goto LAB_009b852e;
  }
  else {
    fVar7 = *(float *)(gpGlobals + 0xc);
    if (*(float *)(this + 0x3f1c) < fVar7) goto joined_r0x009b8679;
    fVar6 = fVar7 + *(float *)(ZombieVomitFadeStart._28_4_ + 0x2c);
    if (fVar6 == *(float *)(this + 0x3f1c)) goto LAB_009b852e;
  }
  if (this[0x6c] == (CTerrorPlayer)0x0) {
    pCVar1 = *(CBaseEdict **)(this + 0x30);
    if (pCVar1 != (CBaseEdict *)0x0) {
      *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
      iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
      *(undefined2 *)(iVar3 + 2) = 0;
    }
  }
  else {
    this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
  }
  *(float *)(this + 0x3f1c) = fVar6;
LAB_009b852e:
  lVar5 = (longdouble)
          RandomFloat(*(undefined4 *)(ZombieVomitHitPitchMin._28_4_ + 0x2c),
                      *(undefined4 *)(ZombieVomitHitPitchMax._28_4_ + 0x2c));
  fVar6 = (float)lVar5;
  lVar5 = (longdouble)
          RandomFloat(*(undefined4 *)(ZombieVomitHitYawMin._28_4_ + 0x2c),
                      *(undefined4 *)(ZombieVomitHitYawMax._28_4_ + 0x2c),fVar6);
  local_14 = (float)lVar5;
  local_10 = 0;
  local_18 = fVar6;
  CBasePlayer::SetPunchAngle((CBasePlayer *)this,(QAngle *)&local_18);
  cVar2 = (**(code **)(*(int *)this + 0x550))(this);
  if (cVar2 == '\0') {
    this_00 = (NextBotManager *)TheNextBots();
    NextBotManager::OnCharacterVomitedUpon(this_00,(CBaseCombatCharacter *)this);
    iVar3 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
    cVar2 = IsASurvivorTeam(iVar3);
    if (cVar2 != '\0') {
      (**(code **)(*(int *)(this + 0x3ab4) + 0x8c))(this + 0x3ab4);
      local_19 = (MobAlert)0x1;
      ForEachTerrorPlayer<MobAlert>(&local_19);
    }
  }
  if ((param_1 == (CBaseCombatCharacter *)0x0) ||
     (cVar2 = (**(code **)(*(int *)param_1 + 0x16c))(param_1), cVar2 == '\0')) {
    *(undefined4 *)(this + 0x3264) = 0xffffffff;
  }
  else {
    puVar4 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
    *(undefined4 *)(this + 0x3264) = *puVar4;
  }
  this[0x3254] = (CTerrorPlayer)0x0;
  iVar3 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
  cVar2 = IsASurvivorTeam(iVar3);
  if (cVar2 == '\0') {
    cVar2 = (**(code **)(*(int *)this + 0x778))(this);
    if (cVar2 == '\0') {
      local_20 = *(float *)(vomitjar_duration_infected_pz._28_4_ + 0x2c);
      lVar5 = (longdouble)CountdownTimer::Now();
      fVar6 = (float)lVar5 + local_20;
      if (fVar6 != *(float *)(this + 0x3260)) {
        (**(code **)(*(int *)(this + 0x3258) + 4))(this + 0x3258,this + 0x3260);
        *(float *)(this + 0x3260) = fVar6;
      }
      if (local_20 == *(float *)(this + 0x325c)) {
        return;
      }
    }
    else {
      local_20 = *(float *)(vomitjar_duration_infected_bot._28_4_ + 0x2c);
      lVar5 = (longdouble)CountdownTimer::Now();
      fVar6 = (float)lVar5 + local_20;
      if (fVar6 != *(float *)(this + 0x3260)) {
        (**(code **)(*(int *)(this + 0x3258) + 4))(this + 0x3258,this + 0x3260);
        *(float *)(this + 0x3260) = fVar6;
      }
      if (local_20 == *(float *)(this + 0x325c)) {
        return;
      }
    }
    (**(code **)(*(int *)(this + 0x3258) + 4))(this + 0x3258,this + 0x325c);
    *(float *)(this + 0x325c) = local_20;
  }
  else {
    fVar6 = *(float *)(vomitjar_duration_survivor._28_4_ + 0x2c);
    lVar5 = (longdouble)CountdownTimer::Now();
    fVar7 = (float)lVar5 + fVar6;
    if (fVar7 != *(float *)(this + 0x3260)) {
      (**(code **)(*(int *)(this + 0x3258) + 4))(this + 0x3258,this + 0x3260);
      *(float *)(this + 0x3260) = fVar7;
    }
    if (fVar6 != *(float *)(this + 0x325c)) {
      (**(code **)(*(int *)(this + 0x3258) + 4))(this + 0x3258,this + 0x325c);
      *(float *)(this + 0x325c) = fVar6;
    }
  }
  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)