L L4D2node

CRopeKeyframe::Init

0x00808ec0 · 713 bytes · __thiscall

_ZN13CRopeKeyframe4InitEv

Decompiled

undefined (1 param)

/* CRopeKeyframe::Init() */

void __thiscall CRopeKeyframe::Init(CRopeKeyframe *this)

{
  uint uVar1;
  CBaseEdict *pCVar2;
  int iVar3;
  undefined *puVar4;
  undefined *puVar5;
  undefined4 uVar6;
  CRopeKeyframe CVar7;
  CRopeKeyframe CVar8;
  float local_28;
  float local_24;
  float local_20;
  
  CBaseEntity::SetLocalAngles((CBaseEntity *)this,(QAngle *)&vec3_angle);
  RecalculateLength(this);
  if (*(int *)(this + 0x458) < 0xb) {
    uVar6 = 2;
    if (1 < *(int *)(this + 0x458)) goto LAB_00808f01;
  }
  else {
    uVar6 = 10;
  }
  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);
  }
  *(undefined4 *)(this + 0x458) = uVar6;
LAB_00808f01:
  UpdateBBox(SUB41(this,0));
  puVar5 = g_pEntityList;
  uVar1 = *(uint *)(this + 0x484);
  CVar7 = (CRopeKeyframe)0x0;
  if (((uVar1 != 0xffffffff) &&
      (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) {
    CVar7 = (CRopeKeyframe)(*(int *)(puVar4 + 4) != 0);
  }
  uVar1 = *(uint *)(this + 0x488);
  CVar8 = (CRopeKeyframe)0x0;
  this[0x480] = CVar7;
  if (((uVar1 != 0xffffffff) &&
      (puVar5 = puVar5 + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) {
    CVar8 = (CRopeKeyframe)(*(int *)(puVar5 + 4) != 0);
  }
  this[0x481] = CVar8;
  if (0.1 <= *(float *)(this + 0x454)) {
    if (10.0 < *(float *)(this + 0x454)) {
      if (((byte)this[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
      }
      local_28 = *(float *)(this + 0x2e0);
      local_24 = *(float *)(this + 0x2e4);
      local_20 = *(float *)(this + 0x2e8);
      GetEndPointPos((int)this,(Vector *)&local_28);
      DevMsg("move_rope has TextureScale greater than 10 at (%2.2f, %2.2f, %2.2f)\n",
             (double)local_28,(double)local_24,(double)local_20);
      if (*(float *)(this + 0x454) != 10.0) {
        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);
        }
        *(undefined4 *)(this + 0x454) = 0x41200000;
      }
    }
  }
  else {
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
    local_28 = *(float *)(this + 0x2e0);
    local_24 = *(float *)(this + 0x2e4);
    local_20 = *(float *)(this + 0x2e8);
    GetEndPointPos((int)this,(Vector *)&local_28);
    DevMsg("move_rope has TextureScale less than 0.1 at (%2.2f, %2.2f, %2.2f)\n",(double)local_28,
           (double)local_24,(double)local_20);
    if (*(float *)(this + 0x454) != 0.1) {
      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);
      }
      *(undefined4 *)(this + 0x454) = 0x3dcccccd;
      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)