L L4D2node

CPhysicsProp::GetCarryDistanceOffset

0x007f1390 · 274 bytes · __thiscall

_ZN12CPhysicsProp22GetCarryDistanceOffsetEv

Decompiled

undefined (1 param)

/* CPhysicsProp::GetCarryDistanceOffset() */

longdouble __thiscall CPhysicsProp::GetCarryDistanceOffset(CPhysicsProp *this)

{
  code *pcVar1;
  char cVar2;
  KeyValues *pKVar3;
  undefined4 uVar4;
  char *pcVar5;
  char *pcVar6;
  longdouble lVar7;
  uint in_stack_ffffffc8;
  
  pKVar3 = KeyValues::operator_new((KeyValues *)0x2c,in_stack_ffffffc8);
                    /* try { // try from 007f13c2 to 007f13c6 has its CatchHandler @ 007f14ab */
  KeyValues::KeyValues(pKVar3,"",(IKeyValuesSystem *)0x0,false);
  pcVar1 = *(code **)(*modelinfo + 0x54);
  uVar4 = CBaseEntity::GetModel((CBaseEntity *)this);
  pcVar5 = (char *)(*pcVar1)(modelinfo,uVar4);
  pcVar1 = *(code **)(*modelinfo + 0x10);
  uVar4 = CBaseEntity::GetModel((CBaseEntity *)this);
  pcVar6 = (char *)(*pcVar1)(modelinfo,uVar4);
  cVar2 = KeyValues::LoadFromBuffer(pKVar3,pcVar6,pcVar5,(IBaseFileSystem *)0x0,(char *)0x0);
  if (cVar2 != '\0') {
    pKVar3 = (KeyValues *)KeyValues::FindKey(pKVar3,"physgun_interactions",false);
    if (pKVar3 != (KeyValues *)0x0) {
      lVar7 = (longdouble)KeyValues::GetFloat(pKVar3,"carry_distance_offset",0.0);
      KeyValues::deleteThis();
      return (longdouble)(float)lVar7;
    }
  }
  KeyValues::deleteThis();
  return (longdouble)0.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)