L L4D2node

ZombieBotLocomotion::UpdateGroundConstraint

0x00a55740 · 2738 bytes · __thiscall

_ZN19ZombieBotLocomotion22UpdateGroundConstraintEv

Decompiled

undefined (1 param)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* ZombieBotLocomotion::UpdateGroundConstraint() */

void __thiscall ZombieBotLocomotion::UpdateGroundConstraint(ZombieBotLocomotion *this)

{
  uint *puVar1;
  float fVar2;
  code *pcVar3;
  char cVar4;
  int iVar5;
  int *piVar6;
  undefined4 uVar7;
  float *pfVar8;
  int iVar9;
  INextBot *pIVar10;
  undefined4 *puVar11;
  Vector *pVVar12;
  CBaseEntity *pCVar13;
  longdouble lVar14;
  longdouble lVar15;
  longdouble lVar16;
  float fVar17;
  float fVar18;
  float fVar19;
  undefined4 local_f4;
  undefined4 local_f0;
  undefined4 local_ec;
  undefined4 local_e8;
  int local_e4;
  undefined **local_e0 [7];
  undefined1 local_c4 [12];
  float local_b8;
  float local_b4;
  float local_b0;
  float local_a4;
  char local_99;
  CBaseEntity *local_84;
  float local_7c;
  float local_78;
  float local_74;
  float local_6c;
  float local_68;
  float local_64;
  undefined4 local_5c;
  undefined4 local_58;
  float local_54;
  float local_4c;
  float local_48;
  float local_44;
  undefined4 local_3c;
  undefined1 local_38;
  undefined1 local_37;
  
  local_f4 = 0;
  local_f0 = 0;
  if (_towlower == 0) {
    local_e4 = 0;
  }
  else {
    (**(code **)(_towlower + 0x50))
              (_towlower,&local_f4,0,0,0,0,
               "/data/src/game/server/terror/zombiebot/zombiebotlocomotion.cpp",0x411,
               &UpdateGroundConstraint()::tm_fmt,"(%s)%s","NextBotExpensive",
               "ZombieBotLocomotion::UpdateGroundConstraint");
    local_e4 = _towlower;
  }
  iVar9 = _DAT_0105db00;
  local_ec = local_f4;
  local_e8 = local_f0;
                    /* try { // try from 00a5588e to 00a558ee has its CatchHandler @ 00a5623e */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar5 = ThreadGetCurrentId(), iVar9 == iVar5)) {
    if ((char *)*_DAT_0105d15c != "ZombieBotLocomotion::UpdateGroundConstraint") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd28900,(char *)0x0,0xca957e);
    }
    puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
    *puVar1 = *puVar1 | 4;
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
                    /* try { // try from 00a5580e to 00a55812 has its CatchHandler @ 00a56242 */
  cVar4 = DidJustJump(this);
                    /* try { // try from 00a5595d to 00a55bdd has its CatchHandler @ 00a56242 */
  if ((cVar4 == '\0') && (cVar4 = (**(code **)(*(int *)this + 0x118))(this), cVar4 == '\0')) {
    piVar6 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
    piVar6 = (int *)(**(code **)(*piVar6 + 0xc4))(piVar6);
    if (piVar6 != (int *)0x0) {
      lVar14 = (longdouble)(**(code **)(*piVar6 + 0x118))(piVar6);
      fVar19 = (float)lVar14 * 0.5;
      lVar14 = (longdouble)(**(code **)(*(int *)this + 0x130))(this);
      lVar15 = (longdouble)(**(code **)(*(int *)this + 0x130))(this);
      CTraceFilterSimple::CTraceFilterSimple
                ((CTraceFilterSimple *)local_e0,*(IHandleEntity **)(this + 0x78),0,
                 IgnoreActorsTraceFilterFunction);
      local_e0[0] = &PTR_ShouldHitEntity_00c23430;
      uVar7 = (**(code **)(*piVar6 + 0x130))(piVar6);
      pfVar8 = (float *)(**(code **)(*(int *)(*(int *)(this + 0x78) + 0x1a3c) + 0xd4))
                                  (*(int *)(this + 0x78) + 0x1a3c);
      fVar18 = *pfVar8;
      fVar17 = pfVar8[2];
      fVar2 = pfVar8[1];
      lVar16 = (longdouble)(**(code **)(*(int *)this + 0x130))(this);
      pfVar8 = (float *)(**(code **)(*(int *)(*(int *)(this + 0x78) + 0x1a3c) + 0xd4))
                                  (*(int *)(this + 0x78) + 0x1a3c);
      local_7c = *pfVar8;
      local_78 = pfVar8[1];
      local_3c = 0;
      local_6c = fVar18 - local_7c;
      local_5c = 0;
      local_74 = (float)lVar16 + pfVar8[2] + 0.001;
      local_58 = 0;
      local_68 = fVar2 - local_78;
      local_64 = ((fVar17 + -0.01) - (float)lVar15) - local_74;
      local_37 = local_68 * local_68 + local_6c * local_6c + local_64 * local_64 != 0.0;
      local_44 = (float)lVar14 * 0.5;
      local_74 = local_74 + local_44;
      local_54 = -local_44;
      local_38 = local_44 * local_44 + fVar19 * fVar19 + fVar19 * fVar19 < 1e-06;
      local_4c = fVar19;
      local_48 = fVar19;
      (**(code **)(*enginetrace + 0x14))
                (enginetrace,(CTakeDamageInfo *)&local_7c,uVar7,(CTraceFilterSimple *)local_e0);
      fVar18 = local_b0;
      if (local_99 == '\0') {
        if (local_a4 < 1.0) {
          this[0xe4] = (ZombieBotLocomotion)0x0;
          *(float *)(this + 0xd0) = local_b0;
          *(float *)(this + 200) = local_b8;
          *(float *)(this + 0xcc) = local_b4;
          fVar17 = *(float *)(this + 0x70) * local_b4 + *(float *)(this + 0x6c) * local_b8 +
                   local_b0 * *(float *)(this + 0x74);
          *(float *)(this + 0x6c) = *(float *)(this + 0x6c) - local_b8 * fVar17;
          *(float *)(this + 0x70) = *(float *)(this + 0x70) - local_b4 * fVar17;
          *(float *)(this + 0x74) = *(float *)(this + 0x74) - fVar17 * local_b0;
          lVar14 = (longdouble)(**(code **)(*(int *)this + 0x154))(this);
          if (fVar18 < (float)lVar14) {
            if (local_b4 * *(float *)(this + 0x70) + local_b8 * *(float *)(this + 0x6c) <= 0.0) {
                    /* try { // try from 00a561d2 to 00a561fa has its CatchHandler @ 00a56242 */
              piVar6 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
              (**(code **)(*piVar6 + 0x1c))(piVar6,local_84);
            }
            fVar18 = *(float *)(this + 0x98) * *(float *)(this + 0xcc) +
                     *(float *)(this + 0x94) * *(float *)(this + 200) +
                     *(float *)(this + 0x9c) * *(float *)(this + 0xd0);
            *(float *)(this + 0x94) = *(float *)(this + 0x94) - *(float *)(this + 200) * fVar18;
            *(float *)(this + 0x98) = *(float *)(this + 0x98) - *(float *)(this + 0xcc) * fVar18;
            *(float *)(this + 0x9c) = *(float *)(this + 0x9c) - fVar18 * *(float *)(this + 0xd0);
            pIVar10 = (INextBot *)(**(code **)(*(int *)this + 0xb0))(this);
            cVar4 = INextBot::IsDebugging(pIVar10,0x10);
            if (cVar4 != '\0') {
              DevMsg("%3.2f: ZombieBotLocomotion - Too steep to stand here\n",
                     (double)*(float *)(gpGlobals + 0xc));
                    /* try { // try from 00a56152 to 00a561c7 has its CatchHandler @ 00a5621a */
              pfVar8 = (float *)(**(code **)(*(int *)this + 300))(this);
              local_7c = local_b8 * 20.0 + *pfVar8;
              local_78 = local_b4 * 20.0 + pfVar8[1];
              local_74 = local_b0 * 20.0 + pfVar8[2];
              pVVar12 = (Vector *)(**(code **)(*(int *)this + 300))(this);
              NDebugOverlay::Line(pVVar12,(Vector *)&local_7c,0xff,0x96,0,true,5.0);
            }
            fVar18 = 0.0;
            if (*(float *)(this + 0x74) <= 0.0) {
              fVar18 = *(float *)(this + 0x74);
            }
            *(float *)(this + 0x74) = fVar18;
            fVar18 = 0.0;
            if (*(float *)(this + 0x9c) <= 0.0) {
              fVar18 = *(float *)(this + 0x9c);
            }
            *(float *)(this + 0x9c) = fVar18;
            goto LAB_00a55822;
          }
          if ((local_84 != (CBaseEntity *)0x0) && (local_84 != g_WorldEntity)) {
            piVar6 = (int *)__dynamic_cast(local_84,&CBaseEntity::typeinfo,&Infected::typeinfo,0);
            if (piVar6 != (int *)0x0) {
              CTakeDamageInfo::CTakeDamageInfo
                        ((CTakeDamageInfo *)&local_7c,*(CBaseEntity **)(this + 0x78),
                         *(CBaseEntity **)(this + 0x78),1000.0,1,0);
              piVar6 = (int *)(**(code **)(*piVar6 + 0x570))(piVar6);
              (**(code **)(*piVar6 + 0x124))(piVar6,(CTakeDamageInfo *)&local_7c);
              goto LAB_00a55822;
            }
            piVar6 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
            (**(code **)(*piVar6 + 0x1c))(piVar6,local_84);
          }
          (**(code **)(*(int *)(*(int *)(this + 0x78) + 0x1a3c) + 0xd0))
                    (*(int *)(this + 0x78) + 0x1a3c,local_c4);
          cVar4 = (**(code **)(*(int *)this + 0xf8))(this);
          if ((cVar4 == '\0') ||
             (pCVar13 = (CBaseEntity *)CBaseEntity::GetGroundEntity(*(CBaseEntity **)(this + 0x78)),
             pCVar13 != local_84)) {
            CBaseEntity::SetGroundEntity(*(CBaseEntity **)(this + 0x78),local_84);
            if (local_84 == (CBaseEntity *)0x0) {
              *(undefined4 *)(this + 0xc4) = 0xffffffff;
            }
            else {
              puVar11 = (undefined4 *)(**(code **)(*(int *)local_84 + 0xc))(local_84);
              *(undefined4 *)(this + 0xc4) = *puVar11;
            }
            this[0xc0] = (ZombieBotLocomotion)0x0;
            this[0xc1] = (ZombieBotLocomotion)0x0;
            piVar6 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
            (**(code **)(*piVar6 + 0x18))(piVar6,local_84);
          }
        }
        else {
          cVar4 = (**(code **)(*(int *)this + 0xf8))(this);
          if (cVar4 != '\0') {
            piVar6 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
            pcVar3 = *(code **)(*piVar6 + 0x14);
            uVar7 = CBaseEntity::GetGroundEntity(*(CBaseEntity **)(this + 0x78));
            (*pcVar3)(piVar6,uVar7);
            cVar4 = (**(code **)(*(int *)this + 0xcc))(this);
            if ((cVar4 == '\0') &&
               (cVar4 = (**(code **)(*(int *)this + 0xd0))(this), uVar7 = NextBotGravity._28_4_,
               cVar4 == '\0')) {
              this[0xe4] = (ZombieBotLocomotion)0x1;
              *(float *)(this + 0x9c) = *(float *)(this + 0x9c) - *(float *)(uVar7 + 0x2c);
            }
          }
        }
        iVar9 = _DAT_0105db00;
        if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
           (iVar5 = ThreadGetCurrentId(), iVar9 == iVar5)) {
          cVar4 = CVProfNode::ExitScope();
          if (cVar4 != '\0') {
            _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
          }
          DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
        }
        if (local_e4 == 0) {
          return;
        }
        (**(code **)(local_e4 + 0x54))(local_e4,local_ec,local_e8,0,0,0);
        return;
      }
                    /* try { // try from 00a55c85 to 00a5610c has its CatchHandler @ 00a56242 */
      pIVar10 = (INextBot *)(**(code **)(*(int *)this + 0xb0))(this);
      cVar4 = INextBot::IsDebugging(pIVar10,0x10);
      if ((cVar4 != '\0') && (*(int *)(gpGlobals + 4) == (*(int *)(gpGlobals + 4) / 0x3c) * 0x3c)) {
        iVar9 = (**(code **)(*(int *)(*(int *)(this + 0x78) + 0x1a3c) + 0xd4))
                          (*(int *)(this + 0x78) + 0x1a3c);
        fVar18 = *(float *)(iVar9 + 8);
        iVar9 = (**(code **)(*(int *)(*(int *)(this + 0x78) + 0x1a3c) + 0xd4))
                          (*(int *)(this + 0x78) + 0x1a3c);
        fVar17 = *(float *)(iVar9 + 4);
        pfVar8 = (float *)(**(code **)(*(int *)(*(int *)(this + 0x78) + 0x1a3c) + 0xd4))
                                    (*(int *)(this + 0x78) + 0x1a3c);
        DevMsg("%3.2f: Inside ground, ( %.0f, %.0f, %.0f )\n",(double)*(float *)(gpGlobals + 0xc),
               (double)*pfVar8,(double)fVar17,(double)fVar18);
      }
    }
  }
  else {
    this[0xe4] = (ZombieBotLocomotion)0x0;
  }
LAB_00a55822:
  iVar9 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar5 = ThreadGetCurrentId(), iVar9 == iVar5)) {
    cVar4 = CVProfNode::ExitScope();
    if (cVar4 != '\0') {
      _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
    }
    DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
  }
  if (local_e4 != 0) {
    (**(code **)(local_e4 + 0x54))(local_e4,local_ec,local_e8,0,0,0);
  }
  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)