L L4D2node

CFuncMoveLinear::Spawn

0x006c0b60 · 954 bytes · __thiscall

_ZN15CFuncMoveLinear5SpawnEv

Decompiled

undefined (1 param)

/* WARNING: Removing unreachable block (ram,0x006c0df3) */
/* WARNING: Removing unreachable block (ram,0x006c0f29) */
/* CFuncMoveLinear::Spawn() */

void __thiscall CFuncMoveLinear::Spawn(CFuncMoveLinear *this)

{
  CCollisionProperty *this_00;
  float fVar1;
  float fVar2;
  code *pcVar3;
  char cVar4;
  undefined1 *puVar5;
  int iVar6;
  float fVar7;
  float fVar8;
  float fVar9;
  float fVar10;
  float fVar11;
  float fVar12;
  float fVar13;
  undefined1 *local_20 [2];
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  
  local_10 = *(undefined4 *)(this + 0x4c0);
  local_14 = *(undefined4 *)(this + 0x4bc);
  local_18 = *(undefined4 *)(this + 0x4b8);
  AngleVectors((QAngle *)&local_18,(Vector *)(this + 0x4b8));
  CBaseEntity::SetMoveType((CBaseEntity *)this,7,0);
  pcVar3 = *(code **)(*(int *)this + 0x70);
  (**(code **)(*(int *)this + 0x20))(local_20,this);
  puVar5 = &DAT_00d539c2;
  if (local_20[0] != (undefined1 *)0x0) {
    puVar5 = local_20[0];
  }
  (*pcVar3)(this,puVar5);
  if (*(float *)(this + 0x11c) <= 0.0) {
    fVar10 = *(float *)(this + 0x4d8);
    *(undefined4 *)(this + 0x11c) = 0x42c80000;
  }
  else {
    fVar10 = *(float *)(this + 0x4d8);
  }
  if (0.0 < fVar10) {
    fVar12 = *(float *)(this + 0x4b8);
    fVar11 = *(float *)(this + 0x4bc);
    fVar7 = *(float *)(this + 0x4c0);
  }
  else {
    if ((AllocTempVector()::s_vecTemp == '\0') &&
       (iVar6 = __cxa_guard_acquire(&AllocTempVector()::s_vecTemp), iVar6 != 0)) {
      __cxa_guard_release(&AllocTempVector()::s_vecTemp);
    }
    if ((AllocTempVector()::s_nIndex == '\0') &&
       (iVar6 = __cxa_guard_acquire(&AllocTempVector()::s_nIndex), iVar6 != 0)) {
      AllocTempVector()::s_nIndex = 0;
      __cxa_guard_release(&AllocTempVector()::s_nIndex);
    }
    AllocTempVector()::s_nIndex = AllocTempVector()::s_nIndex + 0x10001 & 0x7f;
    LOCK();
    UNLOCK();
    fVar10 = *(float *)(this + 0x1a8);
    iVar6 = AllocTempVector()::s_nIndex * 0xc;
    fVar9 = *(float *)(this + 0x19c);
    *(float *)(AllocTempVector()::s_vecTemp + iVar6) = fVar10 - fVar9;
    fVar8 = *(float *)(this + 0x1ac);
    fVar13 = *(float *)(this + 0x1a0);
    *(float *)(AllocTempVector()::s_vecTemp + iVar6 + 4) = fVar8 - fVar13;
    fVar1 = *(float *)(this + 0x1b0);
    fVar2 = *(float *)(this + 0x1a4);
    *(float *)(AllocTempVector()::s_vecTemp + iVar6 + 8) = fVar1 - fVar2;
    fVar12 = *(float *)(this + 0x4b8);
    fVar11 = *(float *)(this + 0x4bc);
    fVar7 = *(float *)(this + 0x4c0);
    fVar10 = ((ABS(((fVar10 - fVar9) + -2.0) * fVar12) + ABS(((fVar8 - fVar13) + -2.0) * fVar11)) -
             *(float *)(this + 0x44c)) + ABS(((fVar1 - fVar2) + -2.0) * fVar7);
    *(float *)(this + 0x4d8) = fVar10;
  }
  fVar9 = *(float *)(this + 0x4d4);
  *(undefined4 *)(this + 0xd8) = 0;
  *(undefined4 *)(this + 0xdc) = 0;
  this_00 = (CCollisionProperty *)(this + 0x194);
  fVar13 = *(float *)(this + 0x39c) - fVar12 * fVar10 * fVar9;
  *(float *)(this + 0x49c) = *(float *)(this + 0x3a0);
  fVar8 = *(float *)(this + 0x3a0) - fVar11 * fVar10 * fVar9;
  *(float *)(this + 0x454) = fVar13;
  *(undefined4 *)(this + 0x4a0) = *(undefined4 *)(this + 0x3a4);
  *(float *)(this + 0x458) = fVar8;
  fVar9 = *(float *)(this + 0x3a4) - fVar9 * fVar10 * fVar7;
  *(float *)(this + 0x460) = fVar12 * fVar10 + fVar13;
  *(float *)(this + 0x464) = fVar11 * fVar10 + fVar8;
  *(float *)(this + 0x45c) = fVar9;
  *(float *)(this + 0x498) = *(float *)(this + 0x39c);
  *(float *)(this + 0x468) = fVar10 * fVar7 + fVar9;
  (**(code **)(*(int *)this + 0x6c))(this);
  CBaseEntity::AddFlag((CBaseEntity *)this,0x1000);
  CCollisionProperty::SetSolid(this_00,6);
  if ((*(char **)(this + 0x7c) == "func_water_analog") ||
     (cVar4 = CBaseEntity::ClassMatchesComplex((CBaseEntity *)this,"func_water_analog"),
     cVar4 != '\0')) {
    CCollisionProperty::SetSolidFlags(this_00,(uint)(*(ushort *)(this + 0x1b4) | 0x20));
  }
  if (((*(char **)(this + 0x7c) != "func_water_analog") &&
      (cVar4 = CBaseEntity::ClassMatchesComplex((CBaseEntity *)this,"func_water_analog"),
      cVar4 == '\0')) && (((byte)this[0x148] & 8) != 0)) {
    CCollisionProperty::SetSolidFlags(this_00,(uint)(*(ushort *)(this + 0x1b4) | 4));
  }
  (**(code **)(*(int *)this + 0x290))(this);
  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)