L L4D2node

CPhysHinge::Spawn

0x00773cf0 · 409 bytes · __thiscall

_ZN10CPhysHinge5SpawnEv

Decompiled

undefined (1 param)

/* CPhysHinge::Spawn() */

void __thiscall CPhysHinge::Spawn(CPhysHinge *this)

{
  uint uVar1;
  CBaseEdict *this_00;
  int iVar2;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14;
  int local_10;
  
  *(float *)(this + 0x480) = *(float *)(this + 0x39c);
  *(float *)(this + 0x484) = *(float *)(this + 0x3a0);
  *(float *)(this + 0x488) = *(float *)(this + 0x3a4);
  *(float *)(this + 0x48c) = *(float *)(this + 0x48c) - *(float *)(this + 0x39c);
  *(float *)(this + 0x490) = *(float *)(this + 0x490) - *(float *)(this + 0x3a0);
  *(float *)(this + 0x494) = *(float *)(this + 0x494) - *(float *)(this + 0x3a4);
  VectorNormalize((Vector *)(this + 0x48c));
  UTIL_SnapDirectionToAxis((Vector *)(this + 0x48c),0.002);
  uVar1 = *(uint *)(this + 0x148);
  *(undefined4 *)(this + 0x498) = 0;
  *(undefined4 *)(this + 0x49c) = 0;
  *(undefined4 *)(this + 0x4a0) = 0;
  *(undefined4 *)(this + 0x4a4) = 0;
  if ((uVar1 & 8) != 0) {
    if (*(int *)(this + 0x444) == 0) {
      iVar2 = *(int *)(this + 0x448);
    }
    else {
      iVar2 = *(int *)(this + 0x444);
      if (*(int *)(this + 0x448) != 0) {
        if (uVar1 != (uVar1 & 0xfffffff7)) {
          if (this[0x6c] == (CPhysHinge)0x0) {
            this_00 = *(CBaseEdict **)(this + 0x30);
            if (this_00 != (CBaseEdict *)0x0) {
              *(uint *)this_00 = *(uint *)this_00 | 0x101;
              iVar2 = CBaseEdict::GetChangeAccessor(this_00);
              *(undefined2 *)(iVar2 + 2) = 0;
            }
          }
          else {
            this[0x70] = (CPhysHinge)((byte)this[0x70] | 1);
          }
          *(uint *)(this + 0x148) = uVar1 & 0xfffffff7;
        }
        goto LAB_00773e01;
      }
    }
    local_10 = iVar2;
    local_2c = *(undefined4 *)(this + 0x480);
    local_14 = 1;
    local_28 = *(undefined4 *)(this + 0x484);
    local_24 = *(undefined4 *)(this + 0x488);
    local_20 = *(undefined4 *)(this + 0x48c);
    local_1c = *(undefined4 *)(this + 0x490);
    local_18 = *(undefined4 *)(this + 0x494);
    PhysSetMassCenterOverride((masscenteroverride_t *)&local_2c);
  }
LAB_00773e01:
  (**(code **)(*(int *)this + 0x6c))(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)