L L4D2node

CPhysHinge::IsWorldHinge

0x007751c0 · 196 bytes · __thiscall

_ZN10CPhysHinge12IsWorldHingeERK20hl_constraint_info_tPi

Decompiled

undefined (3 params)

/* CPhysHinge::IsWorldHinge(hl_constraint_info_t const&, int*) */

undefined4 __thiscall
CPhysHinge::IsWorldHinge(CPhysHinge *this,hl_constraint_info_t *param_1,int *param_2)

{
  float fVar1;
  bool bVar2;
  int iVar3;
  int iVar4;
  Vector local_18 [16];
  
  if ((((byte)this[0x148] & 8) == 0) || (*(int *)(param_1 + 0x18) != g_PhysWorldObject)) {
    return 0;
  }
  (**(code **)(**(int **)(param_1 + 0x1c) + 0xf0))(*(int **)(param_1 + 0x1c),local_18,this + 0x48c);
  UTIL_SnapDirectionToAxis(local_18,0.002);
  bVar2 = false;
  iVar4 = -1;
  iVar3 = 0;
  do {
    fVar1 = *(float *)(local_18 + iVar3 * 4);
    if (fVar1 != 0.0) {
      if ((ABS(fVar1) == 1.0) && (iVar4 == -1)) {
        bVar2 = true;
        iVar4 = iVar3;
      }
      else {
        bVar2 = false;
      }
    }
    iVar3 = iVar3 + 1;
  } while (iVar3 != 3);
  if ((bVar2) && (iVar4 != -1)) {
    *param_2 = iVar4;
    return 1;
  }
  return 0;
}

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)