L L4D2node

CGrabController::DetachEntity

0x004ec220 · 687 bytes · __thiscall

_ZN15CGrabController12DetachEntityEb

Decompiled

undefined (2 params)

/* CGrabController::DetachEntity(bool) */

void __thiscall CGrabController::DetachEntity(CGrabController *this,bool param_1)

{
  CBaseEntity *this_00;
  IPhysicsObject *pIVar1;
  int iVar2;
  uint uVar3;
  undefined *puVar4;
  int iVar5;
  CGrabController *pCVar6;
  longdouble lVar7;
  longdouble lVar8;
  float fVar9;
  float fVar10;
  float local_1034;
  float local_1030;
  float local_102c;
  float local_1028;
  float local_1024;
  float local_1020;
  undefined4 local_101c [1027];
  
  uVar3 = *(uint *)(this + 0x2068);
  if ((((uVar3 != 0xffffffff) &&
       (puVar4 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar4 + 8) == uVar3 >> 0xc)) &&
     (this_00 = *(CBaseEntity **)(puVar4 + 4), this_00 != (CBaseEntity *)0x0)) {
    CBaseEntity::SetBlocksLOS(this_00,(bool)this[0x60]);
    iVar2 = (**(code **)(*(int *)this_00 + 0x2b8))(this_00,local_101c,0x400);
    if (0 < iVar2) {
      iVar5 = 0;
      pCVar6 = this + 0x68;
      do {
        pIVar1 = (IPhysicsObject *)local_101c[iVar5];
        if (pIVar1 != (IPhysicsObject *)0x0) {
          (**(code **)(*(int *)pIVar1 + 0x3c))(pIVar1,1);
          (**(code **)(*(int *)pIVar1 + 100))(pIVar1);
          (**(code **)(*(int *)pIVar1 + 0x74))(pIVar1,*(undefined4 *)(pCVar6 + 0x1000));
          (**(code **)(*(int *)pIVar1 + 0x8c))(pIVar1,0,pCVar6);
          uVar3 = (**(code **)(*(int *)pIVar1 + 0x50))(pIVar1);
          (**(code **)(*(int *)pIVar1 + 0x4c))(pIVar1,uVar3 & 0xfffb);
          if (param_1) {
            PhysForceClearVelocity(pIVar1);
          }
          else {
            (**(code **)(*(int *)pIVar1 + 0xd4))(pIVar1,(Vector *)&local_1034,(Vector *)&local_1028)
            ;
            lVar7 = (longdouble)VectorNormalize((Vector *)&local_1034);
            lVar8 = (longdouble)VectorNormalize((Vector *)&local_1028);
            fVar10 = 0.0;
            fVar9 = fVar10;
            if (0.0 <= (float)lVar7 - 375.0) {
              fVar9 = -((float)lVar7 - 375.0);
            }
            if (0.0 <= (float)lVar8 - 720.0) {
              fVar10 = -((float)lVar8 - 720.0);
            }
            local_1034 = local_1034 * fVar9;
            local_1030 = local_1030 * fVar9;
            local_102c = fVar9 * local_102c;
            local_1028 = local_1028 * fVar10;
            local_1024 = local_1024 * fVar10;
            local_1020 = fVar10 * local_1020;
            (**(code **)(*(int *)pIVar1 + 0xd8))(pIVar1,(Vector *)&local_1034,(Vector *)&local_1028)
            ;
          }
        }
        iVar5 = iVar5 + 1;
        pCVar6 = pCVar6 + 4;
      } while (iVar5 != iVar2);
    }
  }
  *(undefined4 *)(this + 0x2068) = 0xffffffff;
  if (physenv != (int *)0x0) {
    (**(code **)(*physenv + 0x7c))(physenv,*(undefined4 *)(this + 0x207c));
  }
  *(undefined4 *)(this + 0x207c) = 0;
  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)