L L4D2node

CTerrorPlayer::OnLeptOnSurvivor

0x009c0780 · 2612 bytes · __thiscall

_ZN13CTerrorPlayer16OnLeptOnSurvivorEPS_

Decompiled

undefined (2 params)

/* CTerrorPlayer::OnLeptOnSurvivor(CTerrorPlayer*) */

void __thiscall CTerrorPlayer::OnLeptOnSurvivor(CTerrorPlayer *this,CTerrorPlayer *param_1)

{
  uint uVar1;
  uint uVar2;
  code *pcVar3;
  CBaseEdict *pCVar4;
  CTerrorPlayer *this_00;
  char cVar5;
  undefined *puVar6;
  uint *puVar7;
  undefined *puVar8;
  int iVar9;
  int *piVar10;
  int *piVar11;
  CTerrorWeapon *this_01;
  undefined4 *puVar12;
  char *pcVar13;
  undefined4 uVar14;
  longdouble lVar15;
  float fVar16;
  int local_74;
  int local_70;
  CAI_Concept local_60 [8];
  undefined4 local_58;
  undefined4 local_54;
  CTerrorPlayer *local_50;
  CTerrorPlayer *local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  float local_3c;
  float local_38;
  float local_34;
  
  if ((((*(int *)(SurvivorNoPounceOrTongue._28_4_ + 0x30) == 0) &&
       ((cVar5 = IsInCommentaryMode(), cVar5 == '\0' ||
        (cVar5 = (**(code **)(*(int *)param_1 + 0x778))(param_1), cVar5 != '\0')))) &&
      ((uVar1 = *(uint *)(param_1 + 0x3e68), uVar1 == 0xffffffff ||
       (((puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc ||
         (*(uint *)(puVar6 + 8) != uVar1 >> 0xc)) || (*(int *)(puVar6 + 4) == 0)))))) &&
     (((uVar1 = *(uint *)(param_1 + 0x3e48), uVar1 == 0xffffffff ||
       (puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
      ((*(uint *)(puVar6 + 8) != uVar1 >> 0xc || (*(int *)(puVar6 + 4) == 0)))))) {
    cVar5 = IsShoving(param_1);
    if (cVar5 != '\0') {
      fVar16 = cosf(*(float *)(versus_shove_jockey_fov_leaping._28_4_ + 0x2c) * 0.008726646);
      cVar5 = (**(code **)(*(int *)param_1 + 0x41c))(param_1,this,fVar16);
      if (cVar5 != '\0') {
        if (((byte)param_1[0x14d] & 8) != 0) {
          CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
        }
        if (((byte)this[0x14d] & 8) != 0) {
          CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
        }
        local_3c = *(float *)(this + 0x2e0) - *(float *)(param_1 + 0x2e0);
        local_38 = *(float *)(this + 0x2e4) - *(float *)(param_1 + 0x2e4);
        local_34 = *(float *)(this + 0x2e8) - *(float *)(param_1 + 0x2e8);
        VectorNormalize((Vector *)&local_3c);
        OnShovedBySurvivor(this,param_1,(Vector *)&local_3c);
        return;
      }
    }
    uVar1 = *(uint *)(param_1 + 0x3ee0);
    if (((uVar1 != 0xffffffff) &&
        (puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
       ((*(uint *)(puVar6 + 8) == uVar1 >> 0xc &&
        (this_00 = *(CTerrorPlayer **)(puVar6 + 4), this_00 != (CTerrorPlayer *)0x0)))) {
      if (this == this_00) {
        return;
      }
      OnRideEnded(this_00,(CTerrorPlayer *)0x0);
    }
    lVar15 = (longdouble)CountdownTimer::Now();
    if ((float)lVar15 != *(float *)(this + 0x3ecc)) {
      (**(code **)(*(int *)(this + 0x3ec4) + 4))(this + 0x3ec4,this + 0x3ecc);
      *(float *)(this + 0x3ecc) = (float)lVar15;
    }
    if (*(float *)(this + 0x3ec8) != 0.0) {
      (**(code **)(*(int *)(this + 0x3ec4) + 4))(this + 0x3ec4,this + 0x3ec8);
      *(undefined4 *)(this + 0x3ec8) = 0;
    }
    puVar7 = (uint *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
    puVar6 = g_pEntityList;
    uVar1 = *puVar7;
    if (((uVar1 == 0xffffffff) ||
        (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 == (undefined *)0xfffffffc)) ||
       (*(uint *)(puVar8 + 8) != uVar1 >> 0xc)) {
      local_74 = 0;
    }
    else {
      local_74 = *(int *)(puVar8 + 4);
    }
    uVar2 = *(uint *)(this + 0x3edc);
    if (((uVar2 == 0xffffffff) ||
        (puVar8 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar8 == (undefined *)0xfffffffc)) ||
       (*(uint *)(puVar8 + 8) != uVar2 >> 0xc)) {
      iVar9 = 0;
    }
    else {
      iVar9 = *(int *)(puVar8 + 4);
    }
    if (local_74 != iVar9) {
      if (this[0x6c] == (CTerrorPlayer)0x0) {
        pCVar4 = *(CBaseEdict **)(this + 0x30);
        if (pCVar4 != (CBaseEdict *)0x0) {
          *(uint *)pCVar4 = *(uint *)pCVar4 | 0x101;
          iVar9 = CBaseEdict::GetChangeAccessor(pCVar4);
          *(undefined2 *)(iVar9 + 2) = 0;
          puVar6 = g_pEntityList;
        }
      }
      else {
        this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
      }
      *(uint *)(this + 0x3edc) = uVar1;
    }
    uVar1 = *(uint *)(this + 0x3ee0);
    if (((uVar1 != 0xffffffff) &&
        (puVar8 = puVar6 + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
       ((*(uint *)(puVar8 + 8) == uVar1 >> 0xc && (*(int *)(puVar8 + 4) != 0)))) {
      if (this[0x6c] == (CTerrorPlayer)0x0) {
        pCVar4 = *(CBaseEdict **)(this + 0x30);
        if (pCVar4 != (CBaseEdict *)0x0) {
          *(uint *)pCVar4 = *(uint *)pCVar4 | 0x101;
          iVar9 = CBaseEdict::GetChangeAccessor(pCVar4);
          *(undefined2 *)(iVar9 + 2) = 0;
          puVar6 = g_pEntityList;
        }
      }
      else {
        this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
      }
      *(undefined4 *)(this + 0x3ee0) = 0xffffffff;
    }
    uVar1 = *(uint *)(param_1 + 0x3edc);
    if ((((uVar1 != 0xffffffff) &&
         (puVar6 = puVar6 + (uVar1 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
        (*(uint *)(puVar6 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar6 + 4) != 0)) {
      if (param_1[0x6c] == (CTerrorPlayer)0x0) {
        pCVar4 = *(CBaseEdict **)(param_1 + 0x30);
        if (pCVar4 != (CBaseEdict *)0x0) {
          *(uint *)pCVar4 = *(uint *)pCVar4 | 0x101;
          iVar9 = CBaseEdict::GetChangeAccessor(pCVar4);
          *(undefined2 *)(iVar9 + 2) = 0;
        }
      }
      else {
        param_1[0x70] = (CTerrorPlayer)((byte)param_1[0x70] | 1);
      }
      *(undefined4 *)(param_1 + 0x3edc) = 0xffffffff;
    }
    puVar7 = (uint *)(**(code **)(*(int *)this + 0xc))(this);
    uVar1 = *puVar7;
    if (((uVar1 == 0xffffffff) ||
        (puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
       (*(uint *)(puVar6 + 8) != uVar1 >> 0xc)) {
      local_70 = 0;
    }
    else {
      local_70 = *(int *)(puVar6 + 4);
    }
    uVar2 = *(uint *)(param_1 + 0x3ee0);
    if (((uVar2 == 0xffffffff) ||
        (puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
       (*(uint *)(puVar6 + 8) != uVar2 >> 0xc)) {
      iVar9 = 0;
    }
    else {
      iVar9 = *(int *)(puVar6 + 4);
    }
    if (local_70 != iVar9) {
      if (param_1[0x6c] == (CTerrorPlayer)0x0) {
        pCVar4 = *(CBaseEdict **)(param_1 + 0x30);
        if (pCVar4 != (CBaseEdict *)0x0) {
          *(uint *)pCVar4 = *(uint *)pCVar4 | 0x101;
          iVar9 = CBaseEdict::GetChangeAccessor(pCVar4);
          *(undefined2 *)(iVar9 + 2) = 0;
        }
      }
      else {
        param_1[0x70] = (CTerrorPlayer)((byte)param_1[0x70] | 1);
      }
      *(uint *)(param_1 + 0x3ee0) = uVar1;
    }
    Vocalize(this,"JockeyZombie.Ride",-1.0,0.0);
    piVar10 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)param_1);
    if (piVar10 != (int *)0x0) {
      (**(code **)(*piVar10 + 0x6a0))(piVar10);
      (**(code **)(*piVar10 + 0x428))(piVar10,0);
      piVar11 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)param_1);
      if ((piVar11 != (int *)0x0) && (piVar10 != piVar11)) {
        (**(code **)(*piVar11 + 0x428))(piVar11,0);
      }
    }
    uVar1 = *(uint *)(param_1 + 0x33c4);
    if ((((uVar1 != 0xffffffff) &&
         (puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
        (*(uint *)(puVar6 + 8) == uVar1 >> 0xc)) &&
       (*(CTerrorPlayer **)(puVar6 + 4) != (CTerrorPlayer *)0x0)) {
      ReleaseTongueVictim(*(CTerrorPlayer **)(puVar6 + 4),false);
    }
    StopRevivingSomeone(param_1,false);
    StopBeingRevived(param_1,false);
    StopUseActions(param_1);
    CBasePlayer::ClearUseEntity((CBasePlayer *)param_1);
    SetPushEntity(param_1,(CBaseEntity *)0x0);
    iVar9 = GetActiveTerrorWeapon(param_1);
    if (iVar9 != 0) {
      this_01 = (CTerrorWeapon *)GetActiveTerrorWeapon(param_1);
      CTerrorWeapon::SuppressHelpingHands(this_01,0.0);
    }
    StopBeingDragged(param_1);
    (**(code **)(*(int *)(param_1 + 0x3ab4) + 0xc4))(param_1 + 0x3ab4);
    CancelStagger(param_1);
    CancelTug(param_1);
    ElectHeroicSurvivorBot(param_1);
    lVar15 = (longdouble)GetCharacterScale(*(undefined4 *)(param_1 + 0x2ba0));
    CBaseAnimating::SetModelScale((CBaseAnimating *)this,(float)lVar15,0.0);
    CBaseEntity::EmitSound((CBaseEntity *)this,"Zombie.Punch",0.0,(float *)0x0);
    local_4c = param_1;
    local_50 = this;
    puVar12 = (undefined4 *)(**(code **)(*(int *)this + 0x288))(this);
    local_48 = *puVar12;
    local_44 = puVar12[1];
    local_40 = puVar12[2];
    ForEachSurvivor<PounceStumbleNearbySurvivors>((PounceStumbleNearbySurvivors *)&local_50);
    *(undefined4 *)(this + 0x3ec0) = 0;
    pcVar13 = (char *)SurvivorCharacterName(*(undefined4 *)(param_1 + 0x2ba0));
    AI_CriteriaSet::AI_CriteriaSet((AI_CriteriaSet *)&local_3c,"subject",pcVar13);
    if (*(int *)(z_jockey_leapton_surv_bark._28_4_ + 0x30) == 0) {
      local_58 = 0;
      local_54 = 0xffffffff;
                    /* try { // try from 009c0f9c to 009c0fcb has its CatchHandler @ 009c1248 */
      CAI_Concept::CAI_Concept(local_60,"SurvivorJockeyed");
      CResponseQueue::Add((CResponseQueue *)g_ResponseQueueManager._12_4_,local_60,
                          (AI_CriteriaSet *)&local_3c,0.0,(CFollowupTargetSpec_t *)&local_58,
                          (CBaseEntity *)this);
    }
    else {
                    /* try { // try from 009c0c2f to 009c0c31 has its CatchHandler @ 009c1248 */
      puVar12 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
      uVar14 = *puVar12;
                    /* try { // try from 009c0c45 to 009c0c8d has its CatchHandler @ 009c1246 */
      CAI_Concept::CAI_Concept(local_60,"SurvivorJockeyed");
      local_58 = 2;
      local_54 = uVar14;
      CResponseQueue::Add((CResponseQueue *)g_ResponseQueueManager._12_4_,local_60,
                          (AI_CriteriaSet *)&local_3c,*(float *)(gpGlobals + 0xc),
                          (CFollowupTargetSpec_t *)&local_58,(CBaseEntity *)0x0);
      local_58 = 0;
      local_54 = 0xffffffff;
                    /* try { // try from 009c0ca7 to 009c0cd6 has its CatchHandler @ 009c122d */
      CAI_Concept::CAI_Concept(local_60,"SurvivorJockeyedOther");
      CResponseQueue::Add((CResponseQueue *)g_ResponseQueueManager._12_4_,local_60,
                          (AI_CriteriaSet *)&local_3c,0.0,(CFollowupTargetSpec_t *)&local_58,
                          (CBaseEntity *)param_1);
    }
                    /* try { // try from 009c0cf2 to 009c0e97 has its CatchHandler @ 009c1248 */
    (**(code **)(**(int **)(this + 0x2910) + 4))(*(int **)(this + 0x2910),0x54,0);
    (**(code **)(**(int **)(param_1 + 0x2910) + 4))(*(int **)(param_1 + 0x2910),0x55,0);
    *(undefined4 *)(this + 0x3f00) = 0x3ecccccd;
    lVar15 = (longdouble)CountdownTimer::Now();
    if ((float)lVar15 + 0.4 != *(float *)(this + 0x3efc)) {
                    /* try { // try from 009c1013 to 009c1015 has its CatchHandler @ 009c1248 */
      (**(code **)(*(int *)(this + 0x3ef4) + 4))(this + 0x3ef4,this + 0x3efc);
      *(float *)(this + 0x3efc) = (float)lVar15 + 0.4;
    }
    if (*(float *)(this + 0x3ef8) != 0.4) {
                    /* try { // try from 009c0f33 to 009c0f35 has its CatchHandler @ 009c1248 */
      (**(code **)(*(int *)(this + 0x3ef4) + 4))(this + 0x3ef4,this + 0x3ef8);
      *(undefined4 *)(this + 0x3ef8) = 0x3ecccccd;
    }
    piVar10 = gameeventmanager;
    *(undefined4 *)(this + 0x3ed0) = *(undefined4 *)(gpGlobals + 0xc);
    piVar10 = (int *)(**(code **)(*piVar10 + 0x1c))(piVar10,"jockey_ride",0,0);
    if (piVar10 != (int *)0x0) {
      pcVar3 = *(code **)(*piVar10 + 0x30);
      uVar14 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this + 0x30));
      (*pcVar3)(piVar10,"userid",uVar14);
      pcVar3 = *(code **)(*piVar10 + 0x30);
      uVar14 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(param_1 + 0x30));
      (*pcVar3)(piVar10,"victim",uVar14);
      (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar10,0);
    }
    CBasePlayer::RumbleEffect((CBasePlayer *)param_1,'!','\0','\x04');
    CBasePlayer::RumbleEffect((CBasePlayer *)param_1,'\'','\0','\x02');
    CBasePlayer::RumbleEffect((CBasePlayer *)this,'!','\0','\x04');
    CBasePlayer::RumbleEffect((CBasePlayer *)this,'\'','\0','\x02');
    AI_CriteriaSet::~AI_CriteriaSet((AI_CriteriaSet *)&local_3c);
    return;
  }
  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)