L L4D2node

CBaseEntity::SetAbsOrigin

0x0060c6e0 · 543 bytes · __thiscall

_ZN11CBaseEntity12SetAbsOriginERK6Vector

Decompiled

undefined (2 params)

/* CBaseEntity::SetAbsOrigin(Vector const&) */

void __thiscall CBaseEntity::SetAbsOrigin(CBaseEntity *this,Vector *param_1)

{
  float fVar1;
  uint uVar2;
  CBaseEdict *pCVar3;
  int iVar4;
  matrix3x4_t *pmVar5;
  undefined *puVar6;
  float local_48;
  float local_44;
  float local_40;
  matrix3x4_t local_3c [48];
  
  CalcAbsolutePosition(this);
  if (((*(float *)param_1 == *(float *)(this + 0x2e0)) &&
      (*(float *)(param_1 + 4) == *(float *)(this + 0x2e4))) &&
     (*(float *)(param_1 + 8) == *(float *)(this + 0x2e8))) {
    return;
  }
  InvalidatePhysicsRecursive(this,1);
  *(uint *)(this + 0x14c) = *(uint *)(this + 0x14c) & 0xfffff7ff;
  *(undefined4 *)(this + 0x2e0) = *(undefined4 *)param_1;
  *(undefined4 *)(this + 0x2e4) = *(undefined4 *)(param_1 + 4);
  *(undefined4 *)(this + 0x2e8) = *(undefined4 *)(param_1 + 8);
  MatrixSetColumn(param_1,3,(matrix3x4_t *)(this + 0x28c));
  uVar2 = *(uint *)(this + 0x188);
  if (((uVar2 == 0xffffffff) ||
      (puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
     ((*(uint *)(puVar6 + 8) != uVar2 >> 0xc || (*(int *)(puVar6 + 4) == 0)))) {
    local_48 = *(float *)param_1;
    local_44 = *(float *)(param_1 + 4);
    local_40 = *(float *)(param_1 + 8);
  }
  else {
    pmVar5 = (matrix3x4_t *)GetParentToWorldTransform(this,local_3c);
    VectorITransform((float *)param_1,pmVar5,&local_48);
  }
  if (local_48 == *(float *)(this + 0x39c)) {
    if ((local_44 == *(float *)(this + 0x3a0)) && (local_40 == *(float *)(this + 0x3a4))) {
      return;
    }
    if ((local_44 == *(float *)(this + 0x3a0)) && (local_40 == *(float *)(this + 0x3a4)))
    goto LAB_0060c812;
  }
  if (this[0x6c] == (CBaseEntity)0x0) {
    pCVar3 = *(CBaseEdict **)(this + 0x30);
    if (pCVar3 != (CBaseEdict *)0x0) {
      *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
      iVar4 = CBaseEdict::GetChangeAccessor(pCVar3);
      *(undefined2 *)(iVar4 + 2) = 0;
    }
  }
  else {
    this[0x70] = (CBaseEntity)((byte)this[0x70] | 1);
  }
  *(float *)(this + 0x39c) = local_48;
  *(float *)(this + 0x3a0) = local_44;
  *(float *)(this + 0x3a4) = local_40;
LAB_0060c812:
  fVar1 = *(float *)(gpGlobals + 0xc);
  if (fVar1 != *(float *)(this + 0x94)) {
    if (this[0x6c] == (CBaseEntity)0x0) {
      pCVar3 = *(CBaseEdict **)(this + 0x30);
      if (pCVar3 != (CBaseEdict *)0x0) {
        *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
        iVar4 = CBaseEdict::GetChangeAccessor(pCVar3);
        *(undefined2 *)(iVar4 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CBaseEntity)((byte)this[0x70] | 1);
    }
    *(float *)(this + 0x94) = fVar1;
  }
  UpdateCell(this);
  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)