L L4D2node

CPhysicsProp::VPhysicsUpdate

0x007f15a0 · 645 bytes · __thiscall

_ZN12CPhysicsProp14VPhysicsUpdateEP14IPhysicsObject

Decompiled

undefined (2 params)

/* CPhysicsProp::VPhysicsUpdate(IPhysicsObject*) */

void __thiscall CPhysicsProp::VPhysicsUpdate(CPhysicsProp *this,IPhysicsObject *param_1)

{
  undefined4 uVar1;
  CPhysicsProp CVar2;
  CBaseEdict *pCVar3;
  int *piVar4;
  byte bVar5;
  CPhysicsProp CVar6;
  char cVar7;
  int iVar8;
  uint uVar9;
  undefined1 local_24 [20];
  
  CVar2 = this[0x167c];
  CBaseEntity::VPhysicsUpdate((CBaseEntity *)this,param_1);
  bVar5 = (**(code **)(*(int *)param_1 + 0xc))(param_1);
  if ((CPhysicsProp)(bVar5 ^ 1) == this[0x167c]) {
    CVar6 = this[0x6c];
    piVar4 = *(int **)(this + 0x238);
  }
  else {
    if (this[0x6c] == (CPhysicsProp)0x0) {
      pCVar3 = *(CBaseEdict **)(this + 0x30);
      CVar6 = (CPhysicsProp)0x0;
      if (pCVar3 != (CBaseEdict *)0x0) {
        *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
        iVar8 = CBaseEdict::GetChangeAccessor(pCVar3);
        *(undefined2 *)(iVar8 + 2) = 0;
        CVar6 = this[0x6c];
      }
    }
    else {
      this[0x70] = (CPhysicsProp)((byte)this[0x70] | 1);
      CVar6 = (CPhysicsProp)0x1;
    }
    this[0x167c] = (CPhysicsProp)(bVar5 ^ 1);
    piVar4 = *(int **)(this + 0x238);
  }
  if (CVar6 == (CPhysicsProp)0x0) {
    pCVar3 = *(CBaseEdict **)(this + 0x30);
    if (pCVar3 != (CBaseEdict *)0x0) {
      *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
      iVar8 = CBaseEdict::GetChangeAccessor(pCVar3);
      *(undefined2 *)(iVar8 + 2) = 0;
    }
  }
  else {
    this[0x70] = (CPhysicsProp)((byte)this[0x70] | 1);
  }
  uVar1 = *(undefined4 *)(gpGlobals + 0xc);
  *(undefined4 *)(this + 0x78) = 0;
  *(undefined4 *)(this + 0x74) = uVar1;
  if ((((byte)this[0x148] & 1) != 0) && (this[0x167c] != (CPhysicsProp)0x0)) {
    COutputEvent::FireOutput
              ((COutputEvent *)(this + 0x1568),(CBaseEntity *)this,(CBaseEntity *)this,0.0);
    uVar9 = *(uint *)(this + 0x148) & 0xfffffffe;
    if (*(uint *)(this + 0x148) != uVar9) {
      if (this[0x6c] == (CPhysicsProp)0x0) {
        pCVar3 = *(CBaseEdict **)(this + 0x30);
        if (pCVar3 != (CBaseEdict *)0x0) {
          *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
          iVar8 = CBaseEdict::GetChangeAccessor(pCVar3);
          *(undefined2 *)(iVar8 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CPhysicsProp)((byte)this[0x70] | 1);
      }
      *(uint *)(this + 0x148) = uVar9;
    }
    if ((piVar4 != (int *)0x0) && (cVar7 = (**(code **)(*piVar4 + 0x2c))(piVar4), cVar7 != '\0')) {
      this[0x1664] = (CPhysicsProp)0x1;
    }
  }
  if ((this[0x165c] != (CPhysicsProp)0x0) && (this[0x167c] == (CPhysicsProp)0x0)) {
    this[0x165c] = (CPhysicsProp)0x0;
    CBaseEntity::SetCollisionGroup((CBaseEntity *)this,0);
  }
  cVar7 = CBaseEntity::IsInWorld((CBaseEntity *)this);
  if (cVar7 == '\0') {
    COutputEvent::FireOutput
              ((COutputEvent *)(this + 0x1610),(CBaseEntity *)this,(CBaseEntity *)this,0.0);
  }
  if (((((this[0x167c] == (CPhysicsProp)0x0) || (piVar4 == (int *)0x0)) ||
       (cVar7 = (**(code **)(*piVar4 + 0x2c))(piVar4), cVar7 == '\0')) &&
      ((this[0x1664] != (CPhysicsProp)0x0 && (((byte)this[0x14a] & 1) != 0)))) &&
     (cVar7 = ShouldDisableMotionOnFreeze(this), cVar7 != '\0')) {
    DevMsg("Disabling motion on phys prop");
    (**(code **)(*piVar4 + 0x40))(piVar4,0);
  }
  if ((this[0x167c] != CVar2) && (*(int *)(this + 0x1658) == 0)) {
    CBaseEntity::ThinkSet((_func_void *)local_24,(float)this,(char *)NavThink);
  }
  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)