L L4D2node

CBaseAnimating::UpdateStepOrigin

0x005e06d0 · 715 bytes · __thiscall

_ZN14CBaseAnimating16UpdateStepOriginEv

Decompiled

undefined (1 param)

/* CBaseAnimating::UpdateStepOrigin() */

void __thiscall CBaseAnimating::UpdateStepOrigin(CBaseAnimating *this)

{
  float fVar1;
  uint uVar2;
  char cVar3;
  int iVar4;
  int *piVar5;
  undefined *puVar6;
  longdouble lVar7;
  float fVar8;
  float fVar9;
  float fVar10;
  float fVar11;
  
  if (*(int *)(npc_height_adjust._28_4_ + 0x30) == 0) {
    *(undefined4 *)(this + 0x47c) = 0;
    *(undefined4 *)(this + 0x478) = *(undefined4 *)(this + 0x3a4);
    return;
  }
  if ((((0.2 < *(float *)(this + 0x46c)) &&
       (*(float *)(gpGlobals + 0xc) - 0.2 < *(float *)(this + 0x46c))) &&
      ((*(uint *)(this + 0x150) & 0xc00) == 0)) &&
     ((((uVar2 = *(uint *)(this + 0x188), uVar2 == 0xffffffff ||
        (puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
       ((*(uint *)(puVar6 + 8) != uVar2 >> 0xc || (*(int *)(puVar6 + 4) == 0)))) &&
      (iVar4 = CBaseEntity::GetGroundEntity((CBaseEntity *)this), iVar4 != 0)))) {
    piVar5 = (int *)CBaseEntity::GetGroundEntity((CBaseEntity *)this);
    cVar3 = (**(code **)(*piVar5 + 0x154))(piVar5);
    if (cVar3 == '\0') {
      if (((byte)this[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
      }
      fVar9 = *(float *)(this + 0x3a4);
      if (*(float *)(this + 0x2e8) - fVar9 == 0.0) {
        piVar5 = (int *)CBaseEntity::MyNPCPointer();
        fVar9 = 18.0;
        if (piVar5 != (int *)0x0) {
          lVar7 = (longdouble)(**(code **)(*piVar5 + 0x7b0))(piVar5);
          fVar9 = (float)lVar7;
        }
        fVar8 = (*(float *)(this + 0x474) - *(float *)(this + 0x470)) - fVar9;
        fVar1 = *(float *)(this + 0x470) * 0.8 + *(float *)(this + 0x478) * 0.2;
        fVar10 = 0.0;
        if (0.0 <= fVar8) {
          fVar10 = fVar8;
        }
        *(float *)(this + 0x478) = fVar1;
        if (((byte)this[0x14d] & 8) != 0) {
          CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
        }
        fVar11 = *(float *)(this + 0x2e8);
        if (fVar1 - fVar11 <= 0.0) {
          fVar1 = *(float *)(this + 0x478);
          if (((byte)this[0x14d] & 8) != 0) {
            CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
            fVar11 = *(float *)(this + 0x2e8);
          }
          fVar9 = (float)(~-(uint)(fVar8 <= fVar9) & (uint)fVar9 |
                         (uint)fVar10 & -(uint)(fVar8 <= fVar9)) - fVar9;
          if (fVar9 <= fVar1 - fVar11) {
            fVar9 = *(float *)(this + 0x478);
            if (((byte)this[0x14d] & 8) != 0) {
              CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
              fVar11 = *(float *)(this + 0x2e8);
            }
            fVar9 = fVar9 - fVar11;
          }
        }
        else {
          fVar9 = 0.0;
        }
        *(float *)(this + 0x47c) = fVar9;
        return;
      }
      goto LAB_005e070b;
    }
  }
  fVar9 = *(float *)(this + 0x3a4);
LAB_005e070b:
  *(float *)(this + 0x478) = fVar9;
  *(float *)(this + 0x47c) = *(float *)(this + 0x47c) * 0.5;
  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)