L L4D2node

CItem::CreateItemVPhysicsObject

0x006e2fb0 · 385 bytes · __thiscall

_ZN5CItem24CreateItemVPhysicsObjectEv

Decompiled

undefined (1 param)

/* CItem::CreateItemVPhysicsObject() */

undefined4 __thiscall CItem::CreateItemVPhysicsObject(CItem *this)

{
  CCollisionProperty *this_00;
  uint uVar1;
  int iVar2;
  undefined1 *puVar3;
  uint uVar4;
  double dVar5;
  double dVar6;
  
  this_00 = (CCollisionProperty *)(this + 0x194);
  uVar1 = (**(code **)(*(int *)(this + 0x194) + 0x30))(this_00);
  uVar4 = uVar1 | 0x18;
  if (this[0x1410] != (CItem)0x0) {
    uVar4 = uVar1 | 0x1010;
  }
  iVar2 = (**(code **)(*(int *)this + 0x1c))(this);
  if (iVar2 == 0) {
    return 1;
  }
  iVar2 = CBaseEntity::VPhysicsInitNormal((CBaseEntity *)this,6,uVar4,0,0);
  if (iVar2 != 0) {
    return 1;
  }
  CCollisionProperty::SetSolid(this_00,2);
  CCollisionProperty::SetSolidFlags(this_00,*(ushort *)(this + 0x1b4) | uVar4);
  iVar2 = UTIL_DropToFloor((CBaseEntity *)this,0x200400b,(CBaseEntity *)0x0);
  if (iVar2 != 0) {
    return 1;
  }
  if (((byte)this[0x14d] & 8) == 0) {
    dVar6 = (double)*(float *)(this + 0x2e8);
  }
  else {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    dVar6 = (double)*(float *)(this + 0x2e8);
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
      dVar5 = (double)*(float *)(this + 0x2e4);
      if (((byte)this[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
      }
      goto LAB_006e3088;
    }
  }
  dVar5 = (double)*(float *)(this + 0x2e4);
LAB_006e3088:
  puVar3 = &DAT_00d539c2;
  if (*(undefined1 **)(this + 0x7c) != (undefined1 *)0x0) {
    puVar3 = *(undefined1 **)(this + 0x7c);
  }
  Warning("Item %s fell out of level at %f,%f,%f\n",puVar3,(double)*(float *)(this + 0x2e0),dVar5,
          dVar6);
  UTIL_Remove((CBaseEntity *)this);
  return 0;
}

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)