L L4D2node

CStaticProp::Init

0x001e4fe0 · 930 bytes · __thiscall

_ZN11CStaticProp4InitEiR16StaticPropLump_tP7model_t

Decompiled

undefined (4 params)

/* CStaticProp::Init(int, StaticPropLump_t&, model_t*) */

undefined4 __thiscall
CStaticProp::Init(CStaticProp *this,int param_1,StaticPropLump_t *param_2,model_t *param_3)

{
  undefined4 uVar1;
  CStaticProp CVar2;
  int *piVar3;
  int iVar4;
  char *pcVar5;
  int *piVar6;
  int in_GS_OFFSET;
  char local_124 [260];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  *(undefined2 *)(this + 0x2c) = 0xffff;
  *(uint *)(this + 0x48) = param_1 | 0x40000000;
  *(undefined4 *)(this + 0x10) = *(undefined4 *)param_2;
  *(undefined4 *)(this + 0x14) = *(undefined4 *)(param_2 + 4);
  *(undefined4 *)(this + 0x18) = *(undefined4 *)(param_2 + 8);
  *(undefined4 *)(this + 0x1c) = *(undefined4 *)(param_2 + 0xc);
  *(undefined4 *)(this + 0x20) = *(undefined4 *)(param_2 + 0x10);
  uVar1 = *(undefined4 *)(param_2 + 0x14);
  *(model_t **)(this + 0x28) = param_3;
  *(undefined4 *)(this + 0x24) = uVar1;
  *(undefined2 *)(this + 0x42) = *(undefined2 *)(param_2 + 0x1a);
  *(undefined2 *)(this + 0x44) = *(undefined2 *)(param_2 + 0x1c);
  this[0x39] = *(CStaticProp *)(param_2 + 0x1e);
  *(undefined2 *)(this + 0x4e) = *(undefined2 *)(param_2 + 0x18);
  *(float *)(this + 0xc4) = (float)(byte)param_2[0x40] * 0.003921569;
  *(float *)(this + 200) = (float)(byte)param_2[0x41] * 0.003921569;
  *(float *)(this + 0xcc) = (float)(byte)param_2[0x42] * 0.003921569;
  piVar3 = g_pMDLCache;
  *(float *)(this + 0xd0) = (float)(byte)param_2[0x43] * 0.003921569;
  (**(code **)(*piVar3 + 0x68))(piVar3);
                    /* try { // try from 001e50f0 to 001e52c8 has its CatchHandler @ 001e5395 */
  iVar4 = (**(code **)(*(int *)modelinfo + 0x7c))(modelinfo,*(undefined4 *)(this + 0x28));
  if (((iVar4 != 0) && ((*(byte *)(iVar4 + 0x98) & 0x10) == 0)) &&
     (Init(int,StaticPropLump_t&,model_t*)::nBitchCount < 100)) {
                    /* try { // try from 001e531b to 001e5372 has its CatchHandler @ 001e5395 */
    Warning("model %s used as a static prop, but not compiled as a static prop\n",iVar4 + 0xc);
    Init(int,StaticPropLump_t&,model_t*)::nBitchCount =
         Init(int,StaticPropLump_t&,model_t*)::nBitchCount + 1;
  }
  if ((6 < (byte)this[0x39]) || ((1 << ((byte)this[0x39] & 0x1f) & 0x45U) == 0)) {
    if (*(int *)(this + 0x28) == 0) {
      pcVar5 = "unknown model";
    }
    else {
      pcVar5 = (char *)(**(code **)(*(int *)modelloader + 0x10))(modelloader,*(int *)(this + 0x28));
    }
    V_strncpy(local_124,pcVar5,0x104);
    Warning("CStaticProp::Init:  Map error, static_prop with bogus SOLID_ flag (%d)! (%s)\n",
            this[0x39],local_124);
    this[0x39] = (CStaticProp)0x0;
  }
  this[0x38] = (CStaticProp)0xff;
  uVar1 = force_disablex360._28_4_;
  this[0x3a] = SUB41(*(undefined4 *)(param_2 + 0x20),0);
  this[0x3b] = (CStaticProp)((byte)param_2[0x1f] & 0x40);
  this[0x3c] = *(CStaticProp *)(param_2 + 0x3c);
  this[0x3d] = *(CStaticProp *)(param_2 + 0x3d);
  this[0x3e] = *(CStaticProp *)(param_2 + 0x3e);
  this[0x3f] = *(CStaticProp *)(param_2 + 0x3f);
  CVar2 = *(CStaticProp *)(param_2 + 0x44);
  this[0x40] = CVar2;
  if ((*(int *)(uVar1 + 0x30) != 0) && (CVar2 != (CStaticProp)0x0)) {
    this[0x39] = (CStaticProp)0x0;
  }
  AngleMatrix((QAngle *)(param_2 + 0xc),(Vector *)param_2,(matrix3x4_t *)(this + 0x6c));
  (**(code **)(*(int *)modelinfo + 0x24))
            (modelinfo,*(undefined4 *)(this + 0x28),(Vector *)(this + 0x54),(Vector *)(this + 0x60))
  ;
  *(float *)(this + 0x9c) =
       SQRT((*(float *)(this + 0x5c) - *(float *)(this + 0x68)) *
            (*(float *)(this + 0x5c) - *(float *)(this + 0x68)) +
            (*(float *)(this + 0x58) - *(float *)(this + 100)) *
            (*(float *)(this + 0x58) - *(float *)(this + 100)) +
            (*(float *)(this + 0x54) - *(float *)(this + 0x60)) *
            (*(float *)(this + 0x54) - *(float *)(this + 0x60))) * 0.5;
  TransformAABB((matrix3x4_t *)(this + 0x6c),(Vector *)(this + 0x54),(Vector *)(this + 0x60),
                (Vector *)(this + 0xa0),(Vector *)(this + 0xac));
  if (((byte)param_2[0x1f] & 2) == 0) {
    (**(code **)(*(int *)modelinfo + 0x74))
              (modelinfo,*(undefined4 *)(this + 0x28),this + 4,this + 0x10,this + 0x1c,this + 0xb8);
  }
  else {
    *(undefined4 *)(this + 0xb8) = *(undefined4 *)(param_2 + 0x2c);
    *(undefined4 *)(this + 0xbc) = *(undefined4 *)(param_2 + 0x30);
    *(undefined4 *)(this + 0xc0) = *(undefined4 *)(param_2 + 0x34);
  }
  piVar6 = (int *)CommandLine_Tier0();
  iVar4 = (**(code **)(*piVar6 + 0x28))(piVar6,"-makedevshots");
  g_MakingDevShots = iVar4 != 0;
  (**(code **)(*piVar3 + 0x6c))(piVar3);
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return 1;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)