L L4D2node

CBeam::SetAbsEndPos

0x00425ed0 · 415 bytes · __thiscall

_ZN5CBeam12SetAbsEndPosERK6Vector

Decompiled

undefined (2 params)

/* CBeam::SetAbsEndPos(Vector const&) */

void __thiscall CBeam::SetAbsEndPos(CBeam *this,Vector *param_1)

{
  uint uVar1;
  CBaseEdict *pCVar2;
  int iVar3;
  undefined *puVar4;
  float fVar5;
  float local_58;
  float local_54;
  float local_50;
  matrix3x4_t local_4c [60];
  
  uVar1 = *(uint *)(this + 0x188);
  if ((((uVar1 == 0xffffffff) ||
       (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar4 + 8) != uVar1 >> 0xc)) || (*(int *)(puVar4 + 4) == 0)) {
    fVar5 = *(float *)param_1;
    if (((fVar5 != *(float *)(this + 0x4d0)) ||
        (*(float *)(param_1 + 4) != *(float *)(this + 0x4d4))) ||
       (*(float *)(param_1 + 8) != *(float *)(this + 0x4d8))) {
      if (this[0x6c] == (CBeam)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar3 + 2) = 0;
          fVar5 = *(float *)param_1;
        }
      }
      else {
        this[0x70] = (CBeam)((byte)this[0x70] | 1);
        fVar5 = *(float *)param_1;
      }
      *(float *)(this + 0x4d0) = fVar5;
      *(undefined4 *)(this + 0x4d4) = *(undefined4 *)(param_1 + 4);
      *(undefined4 *)(this + 0x4d8) = *(undefined4 *)(param_1 + 8);
    }
  }
  else {
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
    MatrixInvert((matrix3x4_t *)(this + 0x28c),local_4c);
    VectorTransform((float *)param_1,local_4c,&local_58);
    if (((local_58 != *(float *)(this + 0x4d0)) || (local_54 != *(float *)(this + 0x4d4))) ||
       (local_50 != *(float *)(this + 0x4d8))) {
      if (this[0x6c] == (CBeam)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar3 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CBeam)((byte)this[0x70] | 1);
      }
      *(float *)(this + 0x4d0) = local_58;
      *(float *)(this + 0x4d4) = local_54;
      *(float *)(this + 0x4d8) = local_50;
      return;
    }
  }
  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)