L L4D2node

CBeam::GetAbsEndPos

0x004261a0 · 389 bytes · __thiscall

_ZNK5CBeam12GetAbsEndPosEv

Decompiled

undefined (1 param)

/* CBeam::GetAbsEndPos() const */

CBeam * __thiscall CBeam::GetAbsEndPos(CBeam *this)

{
  byte *pbVar1;
  int *piVar2;
  uint uVar3;
  byte *pbVar4;
  CBaseEntity *this_00;
  int iVar5;
  undefined *puVar6;
  
  if ((((*(int *)(this + 0x458) == 0) || (*(int *)(this + 0x458) == 3)) ||
      (uVar3 = *(uint *)(this + *(int *)(this + 0x450) * 4 + 0x45c), uVar3 == 0xffffffff)) ||
     (((puVar6 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc ||
       (*(uint *)(puVar6 + 8) != uVar3 >> 0xc)) ||
      ((*(int *)(puVar6 + 4) == 0 || (iVar5 = *(int *)(*(int *)(puVar6 + 4) + 0x30), iVar5 == 0)))))
     ) goto LAB_004261f0;
  pbVar1 = *(byte **)(gpGlobals + 0x58);
  uVar3 = iVar5 - (int)pbVar1 >> 4;
  if (uVar3 == 0) goto LAB_004261f0;
  if (uVar3 < 0x800) {
    if (pbVar1 == (byte *)0x0) goto LAB_004261f0;
    pbVar4 = pbVar1 + uVar3 * 0x10;
    if ((*pbVar4 & 2) != 0) goto LAB_0042626e;
  }
  else {
    if (pbVar1 == (byte *)0x0) goto LAB_004261f0;
LAB_0042626e:
    pbVar4 = pbVar1;
    if ((*pbVar1 & 2) != 0) goto LAB_004261f0;
  }
  piVar2 = *(int **)(pbVar4 + 0xc);
  if ((piVar2 != (int *)0x0) &&
     (this_00 = (CBaseEntity *)(**(code **)(*piVar2 + 0x18))(piVar2), this_00 != (CBaseEntity *)0x0)
     ) {
    if (((byte)this_00[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(this_00);
    }
    return (CBeam *)(this_00 + 0x2e0);
  }
LAB_004261f0:
  uVar3 = *(uint *)(this + 0x188);
  if ((((uVar3 != 0xffffffff) &&
       (puVar6 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar6 + 8) == uVar3 >> 0xc)) && (*(int *)(puVar6 + 4) != 0)) {
    if ((GetAbsEndPos()::vecAbsPos == '\0') &&
       (iVar5 = __cxa_guard_acquire(&GetAbsEndPos()::vecAbsPos), iVar5 != 0)) {
      __cxa_guard_release(&GetAbsEndPos()::vecAbsPos);
    }
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
    VectorTransform((float *)(this + 0x4d0),(matrix3x4_t *)(this + 0x28c),
                    (float *)GetAbsEndPos()::vecAbsPos);
    return (CBeam *)GetAbsEndPos()::vecAbsPos;
  }
  return this + 0x4d0;
}

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)