L L4D2node

CalculateOffsettedPosition

0x0049d080 · 320 bytes · __cdecl

_Z26CalculateOffsettedPositionPK11CBaseEntity19EEntityOffsetMode_tP6Vector

Decompiled

undefined (3 params)

/* CalculateOffsettedPosition(CBaseEntity const*, EEntityOffsetMode_t, Vector*) */

void CalculateOffsettedPosition(CBasePlayer *param_1,int param_2,undefined4 *param_3)

{
  char cVar1;
  undefined4 *puVar2;
  CBasePlayer *this;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  if (param_2 == 1) {
LAB_0049d130:
    (**(code **)(*(int *)param_1 + 0x234))(&local_28,param_1);
    *param_3 = local_28;
    param_3[1] = local_24;
    param_3[2] = local_20;
    return;
  }
  if (param_2 < 2) {
    if (param_2 == 0) {
      puVar2 = (undefined4 *)(**(code **)(*(int *)param_1 + 0x288))(param_1);
      *param_3 = *puVar2;
      param_3[1] = puVar2[1];
      param_3[2] = puVar2[2];
      return;
    }
  }
  else {
    if (param_2 == 2) {
      cVar1 = (**(code **)(*(int *)param_1 + 0x16c))(param_1);
      if (cVar1 != '\0') {
        cVar1 = (**(code **)(*(int *)param_1 + 0x16c))(param_1);
        this = (CBasePlayer *)0x0;
        if (cVar1 != '\0') {
          this = param_1;
        }
        cVar1 = CBasePlayer::IsDead(this);
        if (cVar1 == '\0') {
          (**(code **)(*(int *)this + 0x234))(&local_28,this);
        }
        else {
          local_28 = *(undefined4 *)(this + 0x2d3c);
          local_24 = *(undefined4 *)(this + 0x2d40);
          local_20 = *(undefined4 *)(this + 0x2d44);
        }
        *param_3 = local_28;
        param_3[1] = local_24;
        param_3[2] = local_20;
        return;
      }
      goto LAB_0049d130;
    }
    if (param_2 == 3) {
      *param_3 = 0;
      param_3[1] = 0;
      param_3[2] = 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)