L L4D2node

CBoneFollower::Init

0x00786330 · 729 bytes · __thiscall

_ZN13CBoneFollower4InitEP11CBaseEntityPKcR7solid_tRK6VectorRK6QAngle

Decompiled

undefined (6 params)

/* CBoneFollower::Init(CBaseEntity*, char const*, solid_t&, Vector const&, QAngle const&) */

undefined4 __thiscall
CBoneFollower::Init(CBoneFollower *this,CBaseEntity *param_1,char *param_2,solid_t *param_3,
                   Vector *param_4,QAngle *param_5)

{
  CBaseEdict *pCVar1;
  code *pcVar2;
  ushort uVar3;
  int iVar4;
  int iVar5;
  int *piVar6;
  int *piVar7;
  undefined4 uVar8;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  
  (**(code **)(*(int *)this + 0x50))(this,param_1);
  UTIL_SetModel((CBaseEntity *)this,param_2);
  CBaseEntity::AddEffects((CBaseEntity *)this,0x20);
  iVar4 = (**(code **)(*modelinfo + 0xc))(modelinfo,param_2);
  if (iVar4 != *(int *)(this + 0x440)) {
    if (this[0x6c] == (CBoneFollower)0x0) {
      pCVar1 = *(CBaseEdict **)(this + 0x30);
      if (pCVar1 != (CBaseEdict *)0x0) {
        *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
        iVar5 = CBaseEdict::GetChangeAccessor(pCVar1);
        *(undefined2 *)(iVar5 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CBoneFollower)((byte)this[0x70] | 1);
    }
    *(int *)(this + 0x440) = iVar4;
  }
  iVar4 = *(int *)(param_3 + 0x60c);
  if (iVar4 != *(int *)(this + 0x444)) {
    if (this[0x6c] == (CBoneFollower)0x0) {
      pCVar1 = *(CBaseEdict **)(this + 0x30);
      if (pCVar1 != (CBaseEdict *)0x0) {
        *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
        iVar5 = CBaseEdict::GetChangeAccessor(pCVar1);
        *(undefined2 *)(iVar5 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CBoneFollower)((byte)this[0x70] | 1);
    }
    *(int *)(this + 0x444) = iVar4;
  }
  CBaseEntity::SetAbsOrigin((CBaseEntity *)this,param_4);
  CBaseEntity::SetAbsAngles((CBaseEntity *)this,param_5);
  CBaseEntity::SetMoveType((CBaseEntity *)this,7,0);
  CCollisionProperty::SetSolid((CCollisionProperty *)(this + 0x194),6);
  CBaseEntity::SetCollisionGroup((CBaseEntity *)this,*(int *)(param_1 + 0x234));
  CCollisionProperty::SetSolidFlags
            ((CCollisionProperty *)(this + 0x194),(uint)(*(ushort *)(this + 0x1b4) | 3));
  *(CBoneFollower **)(param_3 + 0x630) = this;
  piVar6 = (int *)CBaseEntity::VPhysicsInitShadow((CBaseEntity *)this,false,false,param_3);
  uVar8 = 0;
  if (piVar6 != (int *)0x0) {
    piVar7 = (int *)(**(code **)(*piVar6 + 0x15c))(piVar6);
    if (piVar7 == (int *)0x0) {
      pcVar2 = *(code **)(*physcollision + 0x60);
      uVar8 = (**(code **)(*piVar6 + 300))(piVar6);
      (*pcVar2)(physcollision,(Vector *)&local_54,(Vector *)&local_48,uVar8,&vec3_origin,&vec3_angle
               );
      CBaseEntity::SetCollisionBounds((CBaseEntity *)this,(Vector *)&local_54,(Vector *)&local_48);
    }
    else {
      (**(code **)(*piVar7 + 0x4c))(piVar7,&local_3c);
      local_54 = local_3c;
      local_50 = local_38;
      local_4c = local_34;
      local_48 = local_2c;
      local_44 = local_28;
      local_40 = local_24;
      CBaseEntity::SetCollisionBounds((CBaseEntity *)this,(Vector *)&local_54,(Vector *)&local_48);
    }
    pcVar2 = *(code **)(*piVar6 + 0x5c);
    uVar3 = (**(code **)(*piVar6 + 0x60))(piVar6);
    (*pcVar2)(piVar6,uVar3 | 4);
    (**(code **)(*piVar6 + 0x38))(piVar6,0);
    uVar8 = (**(code **)(*(int *)param_1 + 0x140))(param_1);
    if ((char)uVar8 != '\0') {
      piVar6 = (int *)(**(code **)(*piVar6 + 0x120))(piVar6);
      (**(code **)(*piVar6 + 0x20))(piVar6,1);
      return uVar8;
    }
    uVar8 = 1;
  }
  return uVar8;
}

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)