L L4D2node

CRagdollProp::VPhysicsCollision

0x00797bc0 · 889 bytes · __thiscall

_ZN12CRagdollProp17VPhysicsCollisionEiP21gamevcollisionevent_t

Decompiled

undefined (3 params)

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

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

{
  gamevcollisionevent_t *pgVar1;
  int iVar2;
  CRagdollProp CVar3;
  CRagdollProp *pCVar4;
  int *piVar5;
  byte *pbVar6;
  uint uVar7;
  CRagdollProp *pCVar8;
  CBaseEntity *pCVar9;
  longdouble lVar10;
  float fVar11;
  undefined1 local_a4 [12];
  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;
  pCVar4 = *(CRagdollProp **)(pgVar1 + 0x68);
  if (this == pCVar4) {
    return;
  }
  piVar5 = *(int **)(this + 0x238);
  if ((piVar5 == (int *)0x0) || (uVar7 = (**(code **)(*piVar5 + 0x50))(piVar5), (uVar7 & 4) == 0)) {
    if (pCVar4 == (CRagdollProp *)0x0) goto LAB_00797c4a;
  }
  else {
    if (pCVar4 == (CRagdollProp *)0x0) goto LAB_00797c4a;
    pCVar8 = (CRagdollProp *)(**(code **)(*(int *)this + 0x2c4))(this,0x7f7fffff);
    if (pCVar4 == pCVar8) {
      return;
    }
  }
  pCVar8 = (CRagdollProp *)(**(code **)(*(int *)this + 0x2c4))(this,0x3f000000);
  if (pCVar4 == pCVar8) {
    return;
  }
LAB_00797c4a:
  if (this[0x1ead] == (CRagdollProp)0x0) {
    CVar3 = this[0x105];
  }
  else {
    HandleFirstCollisionInteractions(this,param_1,param_2);
    CVar3 = this[0x105];
  }
  if (CVar3 != (CRagdollProp)0x0) {
    local_98 = 0;
    lVar10 = (longdouble)CalculateDefaultPhysicsDamage(param_1,param_2,0x3f800000,1,&local_98,0,0);
    fVar11 = (float)lVar10;
    if (0.0 < fVar11) {
      if (this[0x1ead] != (CRagdollProp)0x0) {
        fVar11 = fVar11 * 10.0;
      }
      pCVar9 = *(CBaseEntity **)(pgVar1 + 0x68);
      if ((((pCVar9 == (CBaseEntity *)0x0) &&
           (pbVar6 = *(byte **)(gpGlobals + 0x58), pbVar6 != (byte *)0x0)) && ((*pbVar6 & 2) == 0))
         && (piVar5 = *(int **)(pbVar6 + 0xc), piVar5 != (int *)0x0)) {
        pCVar9 = (CBaseEntity *)(**(code **)(*piVar5 + 0x18))(piVar5);
      }
      (**(code **)(**(int **)(param_2 + 0x1c) + 4))(*(int **)(param_2 + 0x1c),local_94);
      lVar10 = (longdouble)
               (**(code **)(**(int **)(param_2 + param_1 * 4) + 0x78))
                         (*(int **)(param_2 + param_1 * 4));
      local_80 = (float)lVar10;
      iVar2 = param_1 * 0xc;
      local_88 = *(float *)(param_2 + iVar2 + 0x38) * local_80;
      local_84 = *(float *)(param_2 + iVar2 + 0x3c) * local_80;
      local_80 = local_80 * *(float *)(param_2 + iVar2 + 0x40);
      if (((local_88 == vec3_origin) && (local_84 == DAT_01053d4c)) && (local_80 == DAT_01053d50)) {
        lVar10 = (longdouble)(**(code **)(**(int **)pgVar1 + 0x78))(*(int **)pgVar1);
        local_88 = (float)lVar10;
        iVar2 = (uint)(param_1 == 0) * 0xc;
        local_84 = *(float *)(param_2 + iVar2 + 0x3c) * local_88;
        local_80 = *(float *)(param_2 + iVar2 + 0x40) * local_88;
        local_88 = local_88 * *(float *)(param_2 + iVar2 + 0x38);
      }
      CTakeDamageInfo::CTakeDamageInfo
                (local_7c,pCVar9,pCVar9,(Vector *)&local_88,local_94,fVar11,local_98,0,(Vector *)0x0
                );
      PhysCallbackDamage((CBaseEntity *)this,local_7c,param_2,param_1);
    }
  }
  if (this[0x1ead] == (CRagdollProp)0x0) {
    return;
  }
  CBaseEntity::ThinkSet((_func_void *)local_a4,(float)this,(char *)ClearFlagsThink);
  CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc),(char *)0x0);
  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)