L L4D2node

CPhysicsProp::VPhysicsCollision

0x007fa960 · 1147 bytes · __thiscall

_ZN12CPhysicsProp17VPhysicsCollisionEiP21gamevcollisionevent_t

Decompiled

undefined (3 params)

/* CPhysicsProp::VPhysicsCollision(int, gamevcollisionevent_t*) */

void __thiscall
CPhysicsProp::VPhysicsCollision(CPhysicsProp *this,int param_1,gamevcollisionevent_t *param_2)

{
  gamevcollisionevent_t *pgVar1;
  code *pcVar2;
  byte *pbVar3;
  int iVar4;
  char cVar5;
  int iVar6;
  int iVar7;
  int *piVar8;
  CBaseEntity *pCVar9;
  int *piVar10;
  longdouble lVar11;
  float fVar12;
  undefined1 local_ac [20];
  int local_98;
  Vector local_94 [12];
  float local_88;
  float local_84;
  float local_80;
  CTakeDamageInfo local_7c [108];
  
  CBaseEntity::VPhysicsCollision((CBaseEntity *)this,param_1,param_2);
  pgVar1 = param_2 + (uint)(param_1 == 0) * 4;
  piVar10 = *(int **)pgVar1;
  if (((*(float *)(this + 0x1654) != 0.0) &&
      (((piVar8 = (int *)(**(code **)(*piVar10 + 0x48))(), piVar8 == (int *)0x0 ||
        (cVar5 = (**(code **)(*piVar8 + 0x16c))(), cVar5 == '\0')) || (((byte)this[0x149] & 4) == 0)
       ))) && (fVar12 = *(float *)(param_2 + 0x18),
              lVar11 = (longdouble)(**(code **)(*piVar10 + 0x78))(),
              *(float *)(this + 0x1654) <= (float)lVar11 * fVar12)) {
    ComputeEnablingImpulse(this,param_1,param_2);
    EnableMotion(this);
    *(undefined4 *)(this + 0x1654) = 0;
  }
  if (this[0x165d] != (CPhysicsProp)0x0) {
    CBreakableProp::HandleFirstCollisionInteractions((CBreakableProp *)this,param_1,param_2);
  }
  iVar6 = (**(code **)(*(int *)this + 0x2c4))();
  if (iVar6 != 0) {
    HandleAnyCollisionInteractions(this,param_1,param_2);
  }
  piVar10 = (int *)&stack0xffffff14;
  if (((byte)this[0x148] & 2) == 0) {
    local_98 = 0;
    (**(code **)(*(int *)(this + 0x13f4) + 0x4c))();
    lVar11 = (longdouble)CalculateDefaultPhysicsDamage();
    fVar12 = (float)lVar11;
    piVar10 = (int *)&stack0xffffff10;
    if (0.0 < fVar12) {
      if ((this[0x165d] != (CPhysicsProp)0x0) && (this[0x165c] == (CPhysicsProp)0x0)) {
        fVar12 = fVar12 * 10.0;
      }
      pCVar9 = *(CBaseEntity **)(pgVar1 + 0x68);
      if (((pCVar9 == (CBaseEntity *)0x0) &&
          (pbVar3 = *(byte **)(gpGlobals + 0x58), pbVar3 != (byte *)0x0)) &&
         (((*pbVar3 & 2) == 0 && (*(int **)(pbVar3 + 0xc) != (int *)0x0)))) {
        pCVar9 = (CBaseEntity *)(**(code **)(**(int **)(pbVar3 + 0xc) + 0x18))();
      }
      (**(code **)(**(int **)(param_2 + 0x1c) + 4))();
      lVar11 = (longdouble)(**(code **)(**(int **)(param_2 + param_1 * 4) + 0x78))();
      iVar6 = param_1 * 0xc;
      local_80 = (float)lVar11;
      local_88 = *(float *)(param_2 + iVar6 + 0x38) * local_80;
      local_84 = *(float *)(param_2 + iVar6 + 0x3c) * local_80;
      local_80 = local_80 * *(float *)(param_2 + iVar6 + 0x40);
      if (((local_88 == vec3_origin) && (local_84 == DAT_01053d4c)) && (local_80 == DAT_01053d50)) {
        lVar11 = (longdouble)(**(code **)(**(int **)pgVar1 + 0x78))();
        local_88 = (float)lVar11;
        iVar6 = (uint)(param_1 == 0) * 0xc;
        local_84 = *(float *)(param_2 + iVar6 + 0x3c) * local_88;
        local_80 = *(float *)(param_2 + iVar6 + 0x40) * local_88;
        local_88 = local_88 * *(float *)(param_2 + iVar6 + 0x38);
      }
      CTakeDamageInfo::CTakeDamageInfo
                (local_7c,pCVar9,pCVar9,(Vector *)&local_88,local_94,fVar12,local_98,0,(Vector *)0x0
                );
      PhysCallbackDamage((CBaseEntity *)this,local_7c,param_2,param_1);
      piVar10 = (int *)&stack0xffffff10;
    }
  }
  if ((this[0x165c] != (CPhysicsProp)0x0) || (this[0x165d] != (CPhysicsProp)0x0)) {
    iVar6 = *(int *)(pgVar1 + 0x68);
    if (iVar6 != 0) {
      *piVar10 = iVar6;
      piVar10[-1] = 0x7faa19;
      iVar7 = CBaseEntity::MyNPCPointer();
      iVar4 = g_interactionHitByPlayerThrownPhysObj;
      if (iVar7 != 0) {
        *piVar10 = iVar6;
        piVar10[-1] = 0x7faa2b;
        piVar8 = (int *)CBaseEntity::MyNPCPointer();
        if (0 < iVar4) {
          iVar6 = *piVar8;
          piVar10[3] = 0;
          piVar10[2] = (int)this;
          piVar10[1] = iVar4;
          *piVar10 = (int)piVar8;
          pcVar2 = *(code **)(iVar6 + 0x3e0);
          piVar10[-1] = 0x7faa4a;
          (*pcVar2)();
        }
        this[0x165c] = (CPhysicsProp)0x0;
      }
    }
    if (this[0x165d] != (CPhysicsProp)0x0) {
      this[0x165d] = (CPhysicsProp)0x0;
      piVar10[1] = (int)"PROP_CLEARFLAGS";
      *piVar10 = (int)this;
      piVar10[-1] = 0x7faa71;
      CBaseEntity::RegisterThinkContext((CBaseEntity *)*piVar10,(char *)piVar10[1]);
      iVar6 = *(int *)(gpGlobals + 0xc);
      piVar10[1] = (int)this;
      piVar10[5] = (int)"PROP_CLEARFLAGS";
      piVar10[4] = iVar6;
      piVar10[2] = (int)ClearFlagsThink;
      piVar10[3] = 0;
      *piVar10 = (int)local_ac;
      piVar10[-1] = 0x7faaab;
      CBaseEntity::ThinkSet((_func_void *)*piVar10,(float)piVar10[1],(char *)piVar10[2]);
    }
  }
  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)