L L4D2node

CPhysMagnet::DetachAll

0x007a1360 · 228 bytes · __thiscall

_ZN11CPhysMagnet9DetachAllEv

Decompiled

undefined (1 param)

/* CPhysMagnet::DetachAll() */

void __thiscall CPhysMagnet::DetachAll(CPhysMagnet *this)

{
  int iVar1;
  uint uVar2;
  undefined4 *puVar3;
  undefined *puVar4;
  int iVar5;
  
  iVar5 = 0;
  iVar1 = *(int *)(this + 0x1444);
  if (0 < iVar1) {
    do {
      puVar3 = (undefined4 *)(*(int *)(this + 0x1438) + iVar5 * 8);
      uVar2 = puVar3[1];
      if ((((uVar2 != 0xffffffff) &&
           (puVar4 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
          (*(uint *)(puVar4 + 8) == uVar2 >> 0xc)) && (*(float *)(puVar4 + 4) != 0.0)) {
        CBaseEntity::SetShadowCastDistance(*(float *)(puVar4 + 4),0.0);
        puVar3 = (undefined4 *)(iVar5 * 8 + *(int *)(this + 0x1438));
      }
      iVar5 = iVar5 + 1;
      (**(code **)(*physenv + 0x5c))(physenv,*puVar3);
    } while (iVar5 != iVar1);
  }
  *(undefined4 *)(this + 0x1444) = 0;
  CUtlMemory<magnetted_objects_t,int>::Purge((CUtlMemory<magnetted_objects_t,int> *)(this + 0x1438))
  ;
  *(undefined4 *)(this + 0x1454) = 0;
  *(undefined4 *)(this + 0x1448) = *(undefined4 *)(this + 0x1438);
  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)