L L4D2node

CPhysicsProp::OnPhysGunDrop

0x007fa250 · 488 bytes · __thiscall

_ZN12CPhysicsProp13OnPhysGunDropEP11CBasePlayer13PhysGunDrop_t

Decompiled

undefined (3 params)

/* CPhysicsProp::OnPhysGunDrop(CBasePlayer*, PhysGunDrop_t) */

void __thiscall CPhysicsProp::OnPhysGunDrop(CPhysicsProp *this,CBaseEntity *param_1,int param_3)

{
  int iVar1;
  char cVar2;
  ushort uVar3;
  int *piVar4;
  int iVar5;
  undefined4 local_34;
  int local_30 [8];
  
  CBreakableProp::OnPhysGunDrop((CBreakableProp *)this,param_1,param_3);
  if (param_3 == 3) {
    cVar2 = (**(code **)(*(int *)this + 0x440))(this,5);
    if (cVar2 != '\0') {
      local_30[0] = 0;
      local_30[1] = 0;
      local_30[2] = 0x459c4000;
      (**(code **)(**(int **)(this + 0x238) + 0xd8))(*(int **)(this + 0x238),0,local_30);
      local_34 = 0;
      (**(code **)(**(int **)(this + 0x238) + 0x94))(*(int **)(this + 0x238),0,&local_34);
    }
    piVar4 = *(int **)(this + 0x238);
    uVar3 = (**(code **)(*piVar4 + 0x50))(piVar4);
    (**(code **)(*piVar4 + 0x4c))(piVar4,uVar3 | 0x100);
    this[0x165d] = (CPhysicsProp)0x1;
  }
  else if (param_3 == 1) {
    this[0x165c] = (CPhysicsProp)0x1;
    CBaseEntity::SetCollisionGroup((CBaseEntity *)this,0x11);
  }
  COutputEvent::FireOutput((COutputEvent *)(this + 0x15c8),param_1,(CBaseEntity *)this,0.0);
  cVar2 = (**(code **)(*(int *)this + 0x440))(this,0xf);
  if (cVar2 != '\0') {
    local_30[0] = 0;
    local_30[1] = 0;
    local_30[2] = 0;
    local_30[3] = 0;
    local_30[4] = 0;
                    /* try { // try from 007fa2f5 to 007fa345 has its CatchHandler @ 007fa44d */
    GetAllChildren((CBaseEntity *)this,(CUtlVector *)local_30);
    iVar5 = 0;
    if (0 < local_30[3]) {
      do {
        iVar1 = *(int *)(local_30[0] + iVar5 * 4);
        if ((iVar1 != 0) &&
           (piVar4 = (int *)__dynamic_cast(iVar1,&CBaseEntity::typeinfo,
                                           &IParentPropInteraction::typeinfo,0xfffffffe),
           piVar4 != (int *)0x0)) {
          (**(code **)(*piVar4 + 4))(piVar4,param_1,param_3);
        }
        iVar5 = iVar5 + 1;
      } while (iVar5 < local_30[3]);
    }
    local_30[3] = 0;
    CUtlMemory<CBaseEntity*,int>::Purge((CUtlMemory<CBaseEntity*,int> *)local_30);
    local_30[4] = local_30[0];
    CUtlMemory<CBaseEntity*,int>::Purge((CUtlMemory<CBaseEntity*,int> *)local_30);
    return;
  }
  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)