L L4D2node

CTerrorPlayer::UpdateLeap

0x009f9ab0 · 1997 bytes · __thiscall

_ZN13CTerrorPlayer10UpdateLeapEv

Decompiled

undefined (1 param)

/* CTerrorPlayer::UpdateLeap() */

void __thiscall CTerrorPlayer::UpdateLeap(CTerrorPlayer *this)

{
  float fVar1;
  uint uVar2;
  CBaseEntity *this_00;
  char cVar3;
  char cVar4;
  int iVar5;
  undefined *puVar6;
  longdouble lVar7;
  float fVar8;
  float local_b0;
  float local_ac;
  float local_a8;
  float local_a4;
  float local_a0;
  float local_9c;
  float local_98;
  float local_94;
  float local_90;
  float local_8c;
  float local_88;
  float local_84;
  float local_80;
  float local_7c;
  float local_78;
  float local_74;
  
  uVar2 = *(uint *)(this + 0x3ee0);
  if ((((uVar2 != 0xffffffff) &&
       (puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar6 + 8) == uVar2 >> 0xc)) &&
     ((*(int *)(puVar6 + 4) != 0 && (this[0x39f1] == (CTerrorPlayer)0x0)))) {
    CBaseEntity::SetMoveType((CBaseEntity *)this,2,0);
  }
  uVar2 = *(uint *)(this + 0x3edc);
  if (((uVar2 == 0xffffffff) ||
      (puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
     ((*(uint *)(puVar6 + 8) != uVar2 >> 0xc ||
      (this_00 = *(CBaseEntity **)(puVar6 + 4), this_00 == (CBaseEntity *)0x0)))) {
    cVar3 = (**(code **)(*(int *)this + 300))(this);
    if (cVar3 == '\0') {
      return;
    }
    iVar5 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
    if (iVar5 != 3) {
      return;
    }
    iVar5 = (**(code **)(*(int *)this + 0x544))(this);
    if (iVar5 != 5) {
      return;
    }
    cVar3 = (**(code **)(*(int *)this + 0x558))(this);
    if (cVar3 != '\0') {
      return;
    }
    lVar7 = (longdouble)CountdownTimer::Now();
    if ((float)lVar7 < *(float *)(this + 0x30a0)) {
      return;
    }
    lVar7 = (longdouble)RandomFloat(0x40000000,0x40600000);
    Vocalize(this,"JockeyZombie.Recognize",(float)lVar7,(float)lVar7);
    return;
  }
  cVar3 = (**(code **)(*(int *)this_00 + 0x7e8))(this_00);
  if (cVar3 != '\0') {
    OnRideEnded(this,(CTerrorPlayer *)0x0);
    return;
  }
  if (((byte)this_00[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition(this_00);
  }
  local_ac = *(float *)(this_00 + 0x2e0);
  local_a8 = *(float *)(this_00 + 0x2e4);
  local_a4 = *(float *)(this_00 + 0x2e8);
  if (((byte)this[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
  }
  local_a0 = *(float *)(this + 0x2e0);
  local_9c = *(float *)(this + 0x2e4);
  local_98 = *(float *)(this + 0x2e8);
  if (0.0 < *(float *)(this + 0x3efc)) {
    lVar7 = (longdouble)CountdownTimer::Now();
    fVar1 = *(float *)(this + 0x3efc);
    if ((float)lVar7 < fVar1) {
      fVar8 = 1.0;
      if (*(float *)(this + 0x3f00) != 0.0) {
        lVar7 = (longdouble)CountdownTimer::Now();
        fVar8 = 1.0 - (fVar1 - (float)lVar7) / *(float *)(this + 0x3f00);
        if (1.0 <= fVar8) {
          fVar8 = 1.0;
        }
        if (fVar8 <= 0.0) {
          fVar8 = 0.0;
        }
      }
      local_9c = (local_a8 - local_9c) * fVar8 + local_9c;
      local_98 = (local_a4 - local_98) * fVar8 + local_98;
      local_a0 = (local_ac - local_a0) * fVar8 + local_a0;
      CBaseEntity::SetAbsOrigin((CBaseEntity *)this,(Vector *)&local_a0);
      if (this[0x3f04] != (CTerrorPlayer)0x0) {
        this[0x3f04] = (CTerrorPlayer)0x0;
      }
      goto LAB_009f9d07;
    }
  }
  if (this[0x3f04] == (CTerrorPlayer)0x0) {
    this[0x3f04] = (CTerrorPlayer)0x1;
    CBaseEntity::SetAbsOrigin((CBaseEntity *)this,(Vector *)&local_ac);
    (**(code **)(*(int *)this + 0x98))(this,this_00,0xffffffff);
    CBaseEntity::SetMoveType((CBaseEntity *)this,0,0);
  }
LAB_009f9d07:
  fVar1 = *(float *)(ZombieJockeyStaggerSpeed._28_4_ + 0x2c);
  fVar8 = *(float *)(ZombieJockeySpeedBlend._28_4_ + 0x2c);
  lVar7 = (longdouble)RandomFloat(fVar1,fVar1 + fVar1);
  *(float *)(this + 0x3eb8) =
       (float)lVar7 * *(float *)(gpGlobals + 0x10) + *(float *)(this + 0x3eb8);
  lVar7 = (longdouble)RandomFloat(fVar1,fVar1 + fVar1);
  *(float *)(this + 0x3ebc) =
       (float)lVar7 * *(float *)(gpGlobals + 0x10) + *(float *)(this + 0x3ebc);
  lVar7 = (longdouble)RandomFloat(fVar8,fVar8 + fVar8);
  *(float *)(this + 0x3ec0) =
       (float)lVar7 * *(float *)(gpGlobals + 0x10) + *(float *)(this + 0x3ec0);
  lVar7 = (longdouble)CountdownTimer::Now();
  if (*(float *)(this + 0x3ecc) <= (float)lVar7) {
    cVar3 = (**(code **)(*(int *)this_00 + 0x7e8))(this_00);
    local_b0 = *(float *)(ZombieJockeyRideDamage._28_4_ + 0x2c);
    iVar5 = GetDifficulty();
    if (iVar5 == 2) {
      local_b0 = local_b0 + local_b0;
    }
    else if (iVar5 == 3) {
      local_b0 = local_b0 * 3.0;
    }
    cVar4 = (**(code **)(*(int *)this_00 + 0x7e8))(this_00);
    if (cVar4 != '\0') {
      fVar1 = *(float *)(SurvivorIncapacitatedHealth._28_4_ + 0x2c);
      iVar5 = (**(code **)(*(int *)this_00 + 0x1fc))(this_00);
      local_b0 = (fVar1 / (float)iVar5) * local_b0;
    }
    (**(code **)(*(int *)this_00 + 0x234))(&local_7c,this_00);
    (**(code **)(*(int *)this + 0x478))((Vector *)&local_88,this);
    local_94 = local_88 - local_7c;
    local_90 = local_84 - local_78;
    local_8c = local_80 - local_74;
    CTakeDamageInfo::CTakeDamageInfo
              ((CTakeDamageInfo *)&local_7c,(CBaseEntity *)this,(CBaseEntity *)this,local_b0,0x80,0)
    ;
    (**(code **)(*(int *)this + 0x478))((Vector *)&local_88,this);
    CalculateMeleeDamageForce
              ((CTakeDamageInfo *)&local_7c,(Vector *)&local_94,(Vector *)&local_88,1.0);
    CBaseEntity::TakeDamage(this_00,(CTakeDamageInfo *)&local_7c);
    cVar4 = (**(code **)(*(int *)this_00 + 0x7e8))(this_00);
    if (cVar3 != cVar4) {
      lVar7 = (longdouble)CountdownTimer::Now();
      if ((float)lVar7 + 2.0 != *(float *)(this_00 + 0x30a0)) {
        (**(code **)(*(int *)(this_00 + 0x3098) + 4))(this_00 + 0x3098,this_00 + 0x30a0);
        *(float *)(this_00 + 0x30a0) = (float)lVar7 + 2.0;
      }
      if (*(float *)(this_00 + 0x309c) != 2.0) {
        (**(code **)(*(int *)(this_00 + 0x3098) + 4))(this_00 + 0x3098,this_00 + 0x309c);
        *(undefined4 *)(this_00 + 0x309c) = 0x40000000;
      }
    }
    fVar1 = *(float *)(ZombieJockeyRideDamageInterval._28_4_ + 0x2c);
    lVar7 = (longdouble)CountdownTimer::Now();
    if ((float)lVar7 + fVar1 != *(float *)(this + 0x3ecc)) {
      (**(code **)(*(int *)(this + 0x3ec4) + 4))(this + 0x3ec4,this + 0x3ecc);
      *(float *)(this + 0x3ecc) = (float)lVar7 + fVar1;
    }
    if (fVar1 != *(float *)(this + 0x3ec8)) {
      (**(code **)(*(int *)(this + 0x3ec4) + 4))(this + 0x3ec4,this + 0x3ec8);
      *(float *)(this + 0x3ec8) = fVar1;
    }
  }
  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)