L L4D2node

CPhysMagnet::ConstraintBroken

0x0079c170 · 320 bytes · __thiscall

_ZN11CPhysMagnet16ConstraintBrokenEP18IPhysicsConstraint

Decompiled

undefined (2 params)

/* CPhysMagnet::ConstraintBroken(IPhysicsConstraint*) */

void __thiscall CPhysMagnet::ConstraintBroken(CPhysMagnet *this,IPhysicsConstraint *param_1)

{
  uint uVar1;
  int *piVar2;
  int iVar3;
  undefined *puVar4;
  int iVar5;
  longdouble lVar6;
  int local_20;
  
  local_20 = *(int *)(this + 0x1444);
  if (0 < local_20) {
    iVar5 = 0;
    do {
      uVar1 = *(uint *)(*(int *)(this + 0x1438) + 4 + iVar5 * 8);
      if ((((uVar1 != 0xffffffff) &&
           (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
          (*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) &&
         ((*(int *)(puVar4 + 4) != 0 &&
          (*(IPhysicsConstraint **)(*(int *)(this + 0x1438) + iVar5 * 8) == param_1)))) {
        piVar2 = *(int **)(*(int *)(puVar4 + 4) + 0x238);
        if (piVar2 != (int *)0x0) {
          lVar6 = (longdouble)(**(code **)(*piVar2 + 0x78))(piVar2);
          *(float *)(this + 0x1454) = *(float *)(this + 0x1454) - (float)lVar6;
          local_20 = *(int *)(this + 0x1444);
        }
        iVar3 = (local_20 - iVar5) + -1;
        if (0 < iVar3) {
          _V_memmove((void *)(*(int *)(this + 0x1438) + iVar5 * 8),
                     (void *)(*(int *)(this + 0x1438) + 8 + iVar5 * 8),iVar3 * 8);
          local_20 = *(int *)(this + 0x1444);
        }
        *(int *)(this + 0x1444) = local_20 + -1;
        break;
      }
      iVar5 = iVar5 + 1;
    } while (iVar5 != local_20);
  }
  COutputEvent::FireOutput
            ((COutputEvent *)(this + 0x1410),(CBaseEntity *)this,(CBaseEntity *)this,0.0);
                    /* WARNING: Could not recover jumptable at 0x0079c2b2. Too many branches */
                    /* WARNING: Treating indirect jump as call */
  (**(code **)(*physenv + 0x5c))();
  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)