L L4D2node

CRopeKeyframe::RecalculateLength

0x00808810 · 405 bytes · __thiscall

_ZN13CRopeKeyframe17RecalculateLengthEv

Decompiled

undefined (1 param)

/* CRopeKeyframe::RecalculateLength() */

void __thiscall CRopeKeyframe::RecalculateLength(CRopeKeyframe *this)

{
  uint uVar1;
  CBaseEntity *this_00;
  CBaseEdict *pCVar2;
  int iVar3;
  int iVar4;
  undefined *puVar5;
  CBaseEntity *this_01;
  
  uVar1 = *(uint *)(this + 0x488);
  if ((((uVar1 == 0xffffffff) ||
       (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar5 + 8) != uVar1 >> 0xc)) ||
     (this_00 = *(CBaseEntity **)(puVar5 + 4), this_00 == (CBaseEntity *)0x0)) {
    if (*(int *)(this + 0x470) != 0) {
      if (this[0x6c] == (CRopeKeyframe)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CRopeKeyframe)((byte)this[0x70] | 1);
      }
      *(undefined4 *)(this + 0x470) = 0;
    }
  }
  else {
    uVar1 = *(uint *)(this + 0x484);
    this_01 = (CBaseEntity *)0x0;
    if (((uVar1 != 0xffffffff) &&
        (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) {
      this_01 = *(CBaseEntity **)(puVar5 + 4);
    }
    if (((byte)this_00[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(this_00);
    }
    if (((byte)this_01[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(this_01);
    }
    iVar4 = (int)SQRT((*(float *)(this_01 + 0x2e4) - *(float *)(this_00 + 0x2e4)) *
                      (*(float *)(this_01 + 0x2e4) - *(float *)(this_00 + 0x2e4)) +
                      (*(float *)(this_01 + 0x2e0) - *(float *)(this_00 + 0x2e0)) *
                      (*(float *)(this_01 + 0x2e0) - *(float *)(this_00 + 0x2e0)) +
                      (*(float *)(this_01 + 0x2e8) - *(float *)(this_00 + 0x2e8)) *
                      (*(float *)(this_01 + 0x2e8) - *(float *)(this_00 + 0x2e8)));
    if (iVar4 != *(int *)(this + 0x470)) {
      if (this[0x6c] == (CRopeKeyframe)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar3 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CRopeKeyframe)((byte)this[0x70] | 1);
      }
      *(int *)(this + 0x470) = iVar4;
      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)