L L4D2node

CTerrorPlayer::OnVomitedUpon

0x009b7f70 · 1313 bytes · __thiscall

_ZN13CTerrorPlayer13OnVomitedUponEPS_b

Decompiled

undefined (3 params)

/* CTerrorPlayer::OnVomitedUpon(CTerrorPlayer*, bool) */

void __thiscall
CTerrorPlayer::OnVomitedUpon(CTerrorPlayer *this,CTerrorPlayer *param_1,bool param_2)

{
  float fVar1;
  uint uVar2;
  CBaseEdict *pCVar3;
  code *pcVar4;
  char cVar5;
  undefined4 *puVar6;
  int iVar7;
  NextBotManager *this_00;
  longdouble lVar8;
  longdouble lVar9;
  float fVar10;
  MobAlert local_30 [8];
  float local_28;
  float local_24;
  undefined4 local_20;
  
  cVar5 = IsInCommentaryMode();
  if ((cVar5 != '\0') && (cVar5 = (**(code **)(*(int *)this + 0x778))(this), cVar5 == '\0')) {
    return;
  }
  iVar7 = gpGlobals;
  fVar10 = *(float *)(this + 0x3f18);
  if (fVar10 == 0.0) {
    fVar1 = *(float *)(gpGlobals + 0xc);
joined_r0x009b81ed:
    if (fVar10 != fVar1) {
      if (this[0x6c] == (CTerrorPlayer)0x0) {
        pCVar3 = *(CBaseEdict **)(this + 0x30);
        if (pCVar3 != (CBaseEdict *)0x0) {
          *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
          iVar7 = CBaseEdict::GetChangeAccessor(pCVar3);
          *(undefined2 *)(iVar7 + 2) = 0;
          iVar7 = gpGlobals;
        }
      }
      else {
        this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
      }
      *(float *)(this + 0x3f18) = fVar1;
      fVar10 = *(float *)(iVar7 + 0xc);
    }
    fVar10 = fVar10 + *(float *)(ZombieVomitFadeStart._28_4_ + 0x2c);
    if (fVar10 == *(float *)(this + 0x3f1c)) goto LAB_009b7fd2;
  }
  else {
    fVar1 = *(float *)(gpGlobals + 0xc);
    if (*(float *)(this + 0x3f1c) < fVar1) goto joined_r0x009b81ed;
    fVar10 = fVar1 + *(float *)(ZombieVomitFadeStart._28_4_ + 0x2c);
    if (fVar10 == *(float *)(this + 0x3f1c)) goto LAB_009b7fd2;
  }
  if (this[0x6c] == (CTerrorPlayer)0x0) {
    pCVar3 = *(CBaseEdict **)(this + 0x30);
    if (pCVar3 != (CBaseEdict *)0x0) {
      *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
      iVar7 = CBaseEdict::GetChangeAccessor(pCVar3);
      *(undefined2 *)(iVar7 + 2) = 0;
    }
  }
  else {
    this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
  }
  *(float *)(this + 0x3f1c) = fVar10;
LAB_009b7fd2:
  lVar8 = (longdouble)
          RandomFloat(*(undefined4 *)(ZombieVomitHitPitchMin._28_4_ + 0x2c),
                      *(undefined4 *)(ZombieVomitHitPitchMax._28_4_ + 0x2c));
  lVar9 = (longdouble)
          RandomFloat(*(undefined4 *)(ZombieVomitHitYawMin._28_4_ + 0x2c),
                      *(undefined4 *)(ZombieVomitHitYawMax._28_4_ + 0x2c));
  local_24 = (float)lVar9;
  local_20 = 0;
  local_28 = (float)lVar8;
  CBasePlayer::SetPunchAngle((CBasePlayer *)this,(QAngle *)&local_28);
  cVar5 = (**(code **)(*(int *)this + 0x550))(this);
  if (cVar5 == '\0') {
    local_30[0] = (MobAlert)0x1;
    ForEachTerrorPlayer<MobAlert>(local_30);
    this_00 = (NextBotManager *)TheNextBots();
    NextBotManager::OnCharacterVomitedUpon(this_00,(CBaseCombatCharacter *)this);
    (**(code **)(*(int *)(this + 0x3ab4) + 0x8c))(this + 0x3ab4);
  }
  uVar2 = *(uint *)(this + 0x2ba0);
  if (uVar2 < 4) {
    if (param_2) {
      *(int *)(this + uVar2 * 0x34 + 0x2f9c) = *(int *)(this + uVar2 * 0x34 + 0x2f9c) + 1;
    }
    else {
      *(int *)(this + uVar2 * 0x34 + 0x2f98) = *(int *)(this + uVar2 * 0x34 + 0x2f98) + 1;
    }
  }
  if (param_1 == (CTerrorPlayer *)0x0) {
    *(undefined4 *)(this + 0x3264) = 0xffffffff;
  }
  else {
    puVar6 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
    *(undefined4 *)(this + 0x3264) = *puVar6;
  }
  this[0x3254] = (CTerrorPlayer)param_2;
  fVar10 = *(float *)(SurvivorItDuration._28_4_ + 0x2c);
  lVar8 = (longdouble)CountdownTimer::Now();
  if ((float)lVar8 + fVar10 != *(float *)(this + 0x3260)) {
    (**(code **)(*(int *)(this + 0x3258) + 4))(this + 0x3258,this + 0x3260);
    *(float *)(this + 0x3260) = (float)lVar8 + fVar10;
  }
  if (fVar10 != *(float *)(this + 0x325c)) {
    (**(code **)(*(int *)(this + 0x3258) + 4))(this + 0x3258,this + 0x325c);
    *(float *)(this + 0x325c) = fVar10;
  }
  lVar8 = (longdouble)CountdownTimer::Now();
  if (*(float *)(this + 0x324c) <= (float)lVar8) {
    (**(code **)(*(int *)this + 0x850))
              (this,*(undefined4 *)(ZombieNoiseLevelVocalize._28_4_ + 0x2c));
    pcVar4 = *(code **)(*(int *)this + 0x7b4);
    CAI_Concept::CAI_Concept((CAI_Concept *)local_30,"PlayerVomitInFace");
    (*pcVar4)(this,(CAI_Concept *)local_30,1,0,0,0,0);
    lVar8 = (longdouble)CountdownTimer::Now();
    if ((float)lVar8 + 1.5 != *(float *)(this + 0x30a0)) {
      (**(code **)(*(int *)(this + 0x3098) + 4))(this + 0x3098,this + 0x30a0);
      *(float *)(this + 0x30a0) = (float)lVar8 + 1.5;
    }
    if (*(float *)(this + 0x309c) != 1.5) {
      (**(code **)(*(int *)(this + 0x3098) + 4))(this + 0x3098,this + 0x309c);
      *(undefined4 *)(this + 0x309c) = 0x3fc00000;
    }
  }
  if (param_1 == (CTerrorPlayer *)0x0) {
    *(undefined4 *)(this + 0x3250) = 0xffffffff;
  }
  else {
    puVar6 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
    *(undefined4 *)(this + 0x3250) = *puVar6;
  }
  lVar8 = (longdouble)CountdownTimer::Now();
  if ((float)lVar8 + 3.0 != *(float *)(this + 0x324c)) {
    (**(code **)(*(int *)(this + 0x3244) + 4))(this + 0x3244,this + 0x324c);
    *(float *)(this + 0x324c) = (float)lVar8 + 3.0;
  }
  if (*(float *)(this + 0x3248) != 3.0) {
    (**(code **)(*(int *)(this + 0x3244) + 4))(this + 0x3244,this + 0x3248);
    *(undefined4 *)(this + 0x3248) = 0x40400000;
  }
  CBasePlayer::RumbleEffect((CBasePlayer *)this,',','\0','\x04');
  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)