L L4D2node

TankLocomotion::ClimbUpToLedge

0x00af2380 · 1504 bytes · __thiscall

_ZN14TankLocomotion14ClimbUpToLedgeERK6VectorS2_PK11CBaseEntity

Decompiled

undefined (4 params)

/* TankLocomotion::ClimbUpToLedge(Vector const&, Vector const&, CBaseEntity const*) */

uint __thiscall
TankLocomotion::ClimbUpToLedge
          (TankLocomotion *this,Vector *param_1,Vector *param_2,CBaseEntity *param_3)

{
  undefined4 uVar1;
  uint uVar2;
  char cVar3;
  byte bVar4;
  INextBot *pIVar5;
  int *piVar6;
  CBaseEntity *this_00;
  int iVar7;
  IHandleEntity *pIVar8;
  int iVar9;
  undefined *puVar10;
  uint uVar11;
  float fVar12;
  Vector *local_70;
  float local_64;
  float local_60;
  float local_5c;
  QAngle local_58 [4];
  float local_54;
  float local_4c;
  float local_48;
  float local_44;
  float local_40;
  float local_3c;
  float local_38;
  undefined **local_34 [4];
  int *local_24;
  undefined4 local_20;
  
  cVar3 = (**(code **)(*(int *)this + 0xf8))(this);
  if ((cVar3 == '\0') || (uVar11 = (**(code **)(*(int *)this + 200))(this), (char)uVar11 != '\0')) {
    uVar11 = 0;
  }
  else {
    pIVar5 = (INextBot *)(**(code **)(*(int *)this + 0xb0))(this);
    bVar4 = PlayerLocomotion::IsClimbPossible((PlayerLocomotion *)this,pIVar5,param_3);
    if (bVar4 != 0) {
      piVar6 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
      this_00 = (CBaseEntity *)(**(code **)(*piVar6 + 0xb4))(piVar6);
      piVar6 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
      iVar7 = (**(code **)(*piVar6 + 0xb4))(piVar6);
      uVar2 = *(uint *)(iVar7 + 0x30bc);
      if ((((uVar2 == 0xffffffff) ||
           (puVar10 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc))
          || (*(uint *)(puVar10 + 8) != uVar2 >> 0xc)) ||
         ((piVar6 = *(int **)(puVar10 + 4), piVar6 == (int *)0x0 ||
          (cVar3 = (**(code **)(*piVar6 + 0x354))(piVar6), cVar3 == '\0')))) {
        iVar7 = (**(code **)(*(int *)this + 300))(this);
        fVar12 = *(float *)(param_1 + 8) - *(float *)(iVar7 + 8);
        (**(code **)(*(int *)this + 0x130))(this);
        (**(code **)(*(int *)this + 300))(this);
        piVar6 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
        pIVar8 = (IHandleEntity *)(**(code **)(*piVar6 + 0xb4))(piVar6);
        CTraceFilterSimple::CTraceFilterSimple
                  ((CTraceFilterSimple *)local_34,pIVar8,0,IgnoreActorsTraceFilterFunction);
        local_34[0] = &PTR_ShouldHitEntity_00ca96c8;
        local_20 = 0;
        local_24 = piVar6;
        if (fVar12 < 30.0) {
          uVar11 = PlayerLocomotion::ClimbUpToLedge
                             ((PlayerLocomotion *)this,param_1,param_2,param_3);
        }
        else {
          if (ClimbUpToLedge(Vector_const&,Vector_const&,CBaseEntity_const*)::
              bClimbActivitiesInitialized == '\0') {
            ClimbUpToLedge(Vector_const&,Vector_const&,CBaseEntity_const*)::
            bClimbActivitiesInitialized = '\x01';
            iVar7 = 0;
            do {
              iVar9 = (**(code **)(*(int *)this_00 + 0x340))
                                (this_00,(&ClimbUpToLedge(Vector_const&,Vector_const&,CBaseEntity_const*)
                                           ::climbActivities)[iVar7 * 2]);
              CBaseAnimating::GetSequenceLinearMotion
                        ((CBaseAnimating *)this_00,iVar9,(Vector *)&local_40);
              (&DAT_00f61844)[iVar7 * 2] = local_38;
              iVar7 = iVar7 + 1;
            } while (iVar7 != 8);
          }
          local_70 = (Vector *)&local_40;
          uVar11 = 7;
          do {
            if ((&DAT_00f61844)[uVar11 * 2] <= fVar12) goto LAB_00af2510;
            uVar11 = uVar11 - 1;
          } while (uVar11 != 1);
          uVar11 = (uint)(DAT_00f61844 <= fVar12);
LAB_00af2510:
          iVar7 = (&ClimbUpToLedge(Vector_const&,Vector_const&,CBaseEntity_const*)::climbActivities)
                  [uVar11 * 2];
          local_5c = 0.0;
          local_60 = *(float *)(param_2 + 4);
          local_64 = *(float *)param_2;
          VectorNormalize((Vector *)&local_64);
          VectorAngles((Vector *)&local_64,local_58);
          this[0x80] = (TankLocomotion)0x1;
          *(undefined4 *)(this + 0x84) = *(undefined4 *)param_1;
          *(undefined4 *)(this + 0x88) = *(undefined4 *)(param_1 + 4);
          uVar1 = *(undefined4 *)(param_1 + 8);
          this[0x90] = (TankLocomotion)0x0;
          *(undefined4 *)(this + 0x8c) = uVar1;
          if (this_00[0x1a90] != (CBaseEntity)0x1) {
            (**(code **)(*(int *)(this_00 + 0x1a40) + 4))(this_00 + 0x1a40,this_00 + 0x1a90);
            this_00[0x1a90] = (CBaseEntity)0x1;
          }
          if (this_00[0x1a91] != (CBaseEntity)0x0) {
            (**(code **)(*(int *)(this_00 + 0x1a40) + 4))(this_00 + 0x1a40,this_00 + 0x1a91);
            this_00[0x1a91] = (CBaseEntity)0x0;
          }
          CBaseEntity::AddFlag(this_00,2);
          (**(code **)(*(int *)this_00 + 0x5b8))(this_00);
          CMultiPlayerAnimState::StopAllGestures(*(CMultiPlayerAnimState **)(this_00 + 0x2910));
          (**(code **)(*(int *)this_00 + 0x7fc))(this_00,0x5e,uVar11);
          local_38 = -local_5c;
          local_3c = -local_60;
          local_40 = -local_64;
          CTerrorPlayer::SetHangNormal((CTerrorPlayer *)this_00,local_70);
          local_40 = 0.0;
          local_3c = 0.0;
          local_38 = 0.0;
          CBaseEntity::SetAbsVelocity(this_00,local_70);
          local_40 = 0.0;
          local_3c = local_54;
          local_38 = 0.0;
          CBaseEntity::SetAbsAngles(this_00,(QAngle *)local_70);
          if (iVar7 != 0x2cf) {
            iVar7 = (**(code **)(*(int *)this_00 + 0x340))(this_00,iVar7);
            CBaseAnimating::GetSequenceLinearMotion
                      ((CBaseAnimating *)this_00,iVar7,(Vector *)&local_4c);
            VectorYawRotate((Vector *)&local_4c,local_54,(Vector *)&local_4c);
            CBaseEntity::SetMoveType(this_00,0xb,0);
            local_40 = *(float *)param_1 - local_4c;
            local_3c = *(float *)(param_1 + 4) - local_48;
            local_38 = *(float *)(param_1 + 8) - local_44;
            CBaseEntity::SetAbsOrigin(this_00,local_70);
          }
          pIVar5 = (INextBot *)(**(code **)(*(int *)this + 0xb0))(this);
          cVar3 = INextBot::IsDebugging(pIVar5,0x10);
          if (cVar3 != '\0') {
            local_3c = -local_60 * 50.0 + *(float *)(param_1 + 4);
            local_40 = -local_64 * 50.0 + *(float *)param_1;
            local_38 = -local_5c * 50.0 + *(float *)(param_1 + 8);
            NDebugOverlay::HorzArrow(param_1,local_70,10.0,0xff,0xff,0,0xff,true,10.0);
            iVar7 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
            iVar9 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
            NDebugOverlay::Box(param_1,(Vector *)(iVar9 + 0x24),(Vector *)(iVar7 + 0x30),0,0xff,0,10
                               ,10.0);
          }
          CBaseEntity::EmitSound(this_00,"HulkZombie.StartLedgeClimb",0.0,(float *)0x0);
          uVar11 = (uint)bVar4;
        }
      }
    }
  }
  return uVar11;
}

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)