L L4D2node

ZombieBotLocomotion::ApplyAccumulatedApproach

0x00a550d0 · 1570 bytes · __thiscall

_ZN19ZombieBotLocomotion24ApplyAccumulatedApproachEv

Decompiled

undefined (1 param)

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

void __thiscall ZombieBotLocomotion::ApplyAccumulatedApproach(ZombieBotLocomotion *this)

{
  uint *puVar1;
  float fVar2;
  int iVar3;
  char cVar4;
  float *pfVar5;
  int *piVar6;
  int iVar7;
  longdouble lVar8;
  longdouble lVar9;
  float fVar10;
  float fVar11;
  float local_3c;
  float local_38;
  float local_34;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  int local_1c;
  float local_18;
  float local_14;
  float local_10;
  
  local_2c = 0;
  local_28 = 0;
  if (_towlower == 0) {
    local_1c = 0;
  }
  else {
    (**(code **)(_towlower + 0x50))
              (_towlower,&local_2c,0,0,0,0,
               "/data/src/game/server/terror/zombiebot/zombiebotlocomotion.cpp",0x1ad,
               &ApplyAccumulatedApproach()::tm_fmt,"(%s)%s","NextBot",
               "ZombieBotLocomotion::ApplyAccumulatedApproach");
    local_1c = _towlower;
  }
  iVar3 = _DAT_0105db00;
  local_24 = local_2c;
  local_20 = local_28;
                    /* try { // try from 00a55326 to 00a55386 has its CatchHandler @ 00a5570d */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar7 = ThreadGetCurrentId(), iVar3 == iVar7)) {
    if ((char *)*_DAT_0105d15c != "ZombieBotLocomotion::ApplyAccumulatedApproach") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd288d0,(char *)0x0,0xca8906);
    }
    puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
    *puVar1 = *puVar1 | 4;
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
                    /* try { // try from 00a55188 to 00a552bf has its CatchHandler @ 00a55722 */
  pfVar5 = (float *)(**(code **)(*(int *)this + 300))(this);
  fVar2 = *(float *)(this + 8);
  local_38 = *pfVar5;
  local_34 = pfVar5[1];
  if (0.0 < fVar2) {
    if (0.0 < *(float *)(this + 0x138)) {
      local_10 = 1.0 / *(float *)(this + 0x138);
      local_18 = *(float *)(this + 300) * local_10;
      local_14 = *(float *)(this + 0x130) * local_10;
      local_10 = local_10 * *(float *)(this + 0x134);
      lVar8 = (longdouble)(**(code **)(*(int *)this + 0x13c))(this);
      lVar9 = (longdouble)VectorNormalize((Vector *)&local_18);
      *(undefined4 *)(this + 0x138) = 0;
      fVar11 = (float)lVar9;
      if ((float)lVar8 * fVar2 <= (float)lVar9) {
        fVar11 = (float)lVar8 * fVar2;
      }
      local_38 = local_18 * fVar11 + local_38;
      local_34 = fVar11 * local_14 + local_34;
      *(undefined4 *)(this + 300) = vec3_origin;
      *(undefined4 *)(this + 0x130) = DAT_01053d4c;
      *(undefined4 *)(this + 0x134) = DAT_01053d50;
    }
    (**(code **)(*(int *)this + 300))(this);
    piVar6 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
    piVar6 = (int *)(**(code **)(*piVar6 + 0xc4))(piVar6);
    cVar4 = (**(code **)(*piVar6 + 0x104))(piVar6);
    if (cVar4 != '\0') {
                    /* try { // try from 00a55402 to 00a5547f has its CatchHandler @ 00a55722 */
      pfVar5 = (float *)(**(code **)(*(int *)(*(int *)(this + 0x78) + 0x1a3c) + 0xd4))
                                  (*(int *)(this + 0x78) + 0x1a3c);
      fVar11 = pfVar5[1];
      fVar10 = *pfVar5;
      *(undefined4 *)(this + 0x124) = 0;
      *(float *)(this + 0x120) = local_34 - fVar11;
      *(float *)(this + 0x11c) = local_38 - fVar10;
      lVar8 = (longdouble)VectorNormalize((Vector *)(this + 0x11c));
      if (0.001 <= (float)lVar8) {
        cVar4 = DidJustJump(this);
                    /* try { // try from 00a55515 to 00a556f2 has its CatchHandler @ 00a55722 */
        if (((cVar4 == '\0') && (cVar4 = (**(code **)(*(int *)this + 0xf8))(this), cVar4 != '\0'))
           && (cVar4 = (**(code **)(*(int *)this + 0xf8))(this), cVar4 != '\0')) {
          this[0xd4] = (ZombieBotLocomotion)0x0;
          pfVar5 = (float *)(**(code **)(*(int *)this + 0x100))(this);
          fVar11 = pfVar5[2];
          *(float *)(this + 0x124) =
               pfVar5[1] * -*(float *)(this + 0x120) - *pfVar5 * *(float *)(this + 0x11c);
          *(float *)(this + 0x11c) = *(float *)(this + 0x11c) * fVar11;
          *(float *)(this + 0x120) = -(-*(float *)(this + 0x120) * fVar11);
          VectorNormalize((Vector *)(this + 0x11c));
          fVar10 = *(float *)(this + 0x124) * *(float *)(this + 0x74) +
                   *(float *)(this + 0x11c) * *(float *)(this + 0x6c) +
                   *(float *)(this + 0x120) * *(float *)(this + 0x70);
          fVar11 = *(float *)(this + 0xa0);
          lVar8 = (longdouble)(**(code **)(*(int *)this + 0xf4))(this);
          if ((float)lVar8 <= fVar11) {
            lVar8 = (longdouble)(**(code **)(*(int *)this + 0xf4))(this);
            local_38 = (float)lVar8;
          }
          else {
            local_38 = *(float *)(this + 0xa0);
          }
          if (fVar10 < local_38) {
            if (fVar10 <= 0.0) {
              local_3c = 1.0;
            }
            else {
              fVar11 = (fVar10 / local_38) * (fVar10 / local_38);
              local_3c = 1.0 - fVar11 * fVar11;
            }
            lVar8 = (longdouble)(**(code **)(*(int *)this + 0x180))(this);
            local_3c = (float)lVar8 * local_3c;
            if (local_38 < fVar2 * local_3c + fVar10) {
              local_3c = (local_38 - fVar10) / fVar2;
            }
            *(float *)(this + 0x98) = *(float *)(this + 0x120) * local_3c + *(float *)(this + 0x98);
            *(float *)(this + 0x9c) = *(float *)(this + 0x124) * local_3c + *(float *)(this + 0x9c);
            *(float *)(this + 0x94) = local_3c * *(float *)(this + 0x11c) + *(float *)(this + 0x94);
          }
        }
        iVar3 = _DAT_0105db00;
        if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
           (iVar7 = ThreadGetCurrentId(), iVar3 == iVar7)) {
          cVar4 = CVProfNode::ExitScope();
          if (cVar4 != '\0') {
            _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
          }
          DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
        }
        if (local_1c == 0) {
          return;
        }
        (**(code **)(local_1c + 0x54))(local_1c,local_24,local_20,0,0,0);
        return;
      }
      *(undefined4 *)(this + 0xac) = 0;
      *(undefined4 *)(this + 0xb0) = 0;
    }
  }
  iVar3 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar7 = ThreadGetCurrentId(), iVar3 == iVar7)) {
    cVar4 = CVProfNode::ExitScope();
    if (cVar4 != '\0') {
      _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
    }
    DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
  }
  if (local_1c != 0) {
    (**(code **)(local_1c + 0x54))(local_1c,local_24,local_20,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)