L L4D2node

CRopeKeyframe::SetupHangDistance

0x00807ba0 · 617 bytes · __thiscall

_ZN13CRopeKeyframe17SetupHangDistanceEf

Decompiled

undefined (2 params)

/* CRopeKeyframe::SetupHangDistance(float) */

undefined4 __thiscall CRopeKeyframe::SetupHangDistance(CRopeKeyframe *this,float param_1)

{
  short sVar1;
  uint uVar2;
  CBaseEntity *this_00;
  CBaseEdict *pCVar3;
  undefined4 uVar4;
  int iVar5;
  CBaseAnimating *pCVar6;
  undefined *puVar7;
  CBaseEntity *this_01;
  float local_3c;
  float local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  this_01 = (CBaseEntity *)0x0;
  uVar2 = *(uint *)(this + 0x484);
  if (((uVar2 != 0xffffffff) &&
      (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar7 + 8) == uVar2 >> 0xc)) {
    this_01 = *(CBaseEntity **)(puVar7 + 4);
  }
  uVar2 = *(uint *)(this + 0x488);
  uVar4 = 0;
  if (((uVar2 != 0xffffffff) &&
      (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar7 + 8) == uVar2 >> 0xc)) {
    this_00 = *(CBaseEntity **)(puVar7 + 4);
    if ((this_01 == (CBaseEntity *)0x0) || (this_00 == (CBaseEntity *)0x0)) {
      uVar4 = 0;
    }
    else {
      if (((byte)this_01[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(this_01);
      }
      local_34 = *(undefined4 *)(this_01 + 0x2e0);
      local_30 = *(undefined4 *)(this_01 + 0x2e4);
      local_2c = *(undefined4 *)(this_01 + 0x2e8);
      iVar5 = (**(code **)(*(int *)this_01 + 0xf0))(this_01);
      if (iVar5 != 0) {
        sVar1 = *(short *)(this + 0x48c);
        pCVar6 = (CBaseAnimating *)(**(code **)(*(int *)this_01 + 0xf0))(this_01);
        CBaseAnimating::GetAttachment
                  (pCVar6,(int)sVar1,(Vector *)&local_34,(Vector *)0x0,(Vector *)0x0,(Vector *)0x0);
      }
      if (((byte)this_00[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(this_00);
      }
      local_28 = *(undefined4 *)(this_00 + 0x2e0);
      local_24 = *(undefined4 *)(this_00 + 0x2e4);
      local_20 = *(undefined4 *)(this_00 + 0x2e8);
      iVar5 = (**(code **)(*(int *)this_00 + 0xf0))(this_00);
      if (iVar5 != 0) {
        sVar1 = *(short *)(this + 0x48e);
        pCVar6 = (CBaseAnimating *)(**(code **)(*(int *)this_00 + 0xf0))(this_00);
        CBaseAnimating::GetAttachment
                  (pCVar6,(int)sVar1,(Vector *)&local_28,(Vector *)0x0,(Vector *)0x0,(Vector *)0x0);
      }
      CalcRopeStartingConditions
                ((Vector *)&local_34,(Vector *)&local_28,10,param_1,&local_38,&local_3c);
      if ((int)local_38 != *(int *)(this + 0x470)) {
        if (this[0x6c] == (CRopeKeyframe)0x0) {
          pCVar3 = *(CBaseEdict **)(this + 0x30);
          if (pCVar3 != (CBaseEdict *)0x0) {
            *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
            iVar5 = CBaseEdict::GetChangeAccessor(pCVar3);
            *(undefined2 *)(iVar5 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CRopeKeyframe)((byte)this[0x70] | 1);
        }
        *(int *)(this + 0x470) = (int)local_38;
      }
      uVar4 = 1;
      if ((int)local_3c != *(int *)(this + 0x44c)) {
        if (this[0x6c] == (CRopeKeyframe)0x0) {
          pCVar3 = *(CBaseEdict **)(this + 0x30);
          if (pCVar3 != (CBaseEdict *)0x0) {
            *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
            iVar5 = CBaseEdict::GetChangeAccessor(pCVar3);
            *(undefined2 *)(iVar5 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CRopeKeyframe)((byte)this[0x70] | 1);
        }
        *(int *)(this + 0x44c) = (int)local_3c;
        return 1;
      }
    }
  }
  return uVar4;
}

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)