L L4D2node

CGameMovement::FullObserverMove

0x004580f0 · 834 bytes · __thiscall

_ZN13CGameMovement16FullObserverMoveEv

Decompiled

undefined (1 param)

/* CGameMovement::FullObserverMove() */

void __thiscall CGameMovement::FullObserverMove(CGameMovement *this)

{
  float fVar1;
  int iVar2;
  CBaseEntity *this_00;
  longdouble lVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  float fVar7;
  float local_4c;
  float local_48;
  float local_44;
  float local_40;
  float local_3c;
  float local_38;
  Vector local_34 [12];
  float local_28;
  float local_24;
  float local_20;
  
  iVar2 = (**(code **)(**(int **)(this + 4) + 0x648))(*(int **)(this + 4));
  if (iVar2 - 4U < 2) {
    this_00 = (CBaseEntity *)(**(code **)(**(int **)(this + 4) + 0x654))(*(int **)(this + 4));
    if (this_00 != (CBaseEntity *)0x0) {
      if (((byte)this_00[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(this_00);
      }
      iVar2 = *(int *)(this + 8);
      *(undefined4 *)(iVar2 + 0x9c) = *(undefined4 *)(this_00 + 0x2e0);
      *(undefined4 *)(iVar2 + 0xa0) = *(undefined4 *)(this_00 + 0x2e4);
      *(undefined4 *)(iVar2 + 0xa4) = *(undefined4 *)(this_00 + 0x2e8);
      if (((byte)this_00[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(this_00);
      }
      iVar2 = *(int *)(this + 8);
      *(undefined4 *)(iVar2 + 0xc) = *(undefined4 *)(this_00 + 0x37c);
      *(undefined4 *)(iVar2 + 0x10) = *(undefined4 *)(this_00 + 0x380);
      *(undefined4 *)(iVar2 + 0x14) = *(undefined4 *)(this_00 + 900);
      if (((byte)this_00[0x14d] & 0x10) != 0) {
        CBaseEntity::CalcAbsoluteVelocity(this_00);
      }
      iVar2 = *(int *)(this + 8);
      *(undefined4 *)(iVar2 + 0x40) = *(undefined4 *)(this_00 + 0x274);
      *(undefined4 *)(iVar2 + 0x44) = *(undefined4 *)(this_00 + 0x278);
      *(undefined4 *)(iVar2 + 0x48) = *(undefined4 *)(this_00 + 0x27c);
      return;
    }
  }
  else if (iVar2 != 6) {
    return;
  }
  if (*(int *)(sv_specnoclip._28_4_ + 0x30) == 0) {
    AngleVectors((QAngle *)(*(int *)(this + 8) + 0xc),(Vector *)&local_4c,(Vector *)&local_40,
                 local_34);
    fVar6 = *(float *)(sv_specspeed._28_4_ + 0x2c);
    iVar2 = *(int *)(this + 8);
    if ((*(byte *)(iVar2 + 0x26) & 2) != 0) {
      fVar6 = fVar6 * 0.5;
    }
    fVar7 = *(float *)(iVar2 + 0x2c) * fVar6;
    fVar6 = fVar6 * *(float *)(iVar2 + 0x30);
    VectorNormalize((Vector *)&local_4c);
    VectorNormalize((Vector *)&local_40);
    local_24 = local_3c * fVar6 + local_48 * fVar7;
    local_28 = fVar6 * local_40 + fVar7 * local_4c;
    local_20 = local_44 * fVar7 + local_38 * fVar6 + *(float *)(*(int *)(this + 8) + 0x34);
    lVar3 = (longdouble)VectorNormalize((Vector *)&local_28);
    fVar6 = (float)lVar3;
    if (*(float *)(sv_maxvelocity._28_4_ + 0x2c) <= (float)lVar3) {
      fVar6 = *(float *)(sv_maxvelocity._28_4_ + 0x2c);
    }
    (**(code **)(*(int *)this + 0x68))
              (this,(Vector *)&local_28,fVar6,*(undefined4 *)(sv_specaccelerate._28_4_ + 0x2c));
    iVar2 = *(int *)(this + 8);
    fVar6 = *(float *)(iVar2 + 0x40);
    fVar7 = *(float *)(iVar2 + 0x48);
    fVar1 = *(float *)(iVar2 + 0x44);
    fVar4 = SQRT(fVar7 * fVar7 + fVar6 * fVar6 + fVar1 * fVar1);
    if (fVar4 < 1.0) {
      *(undefined4 *)(iVar2 + 0x40) = 0;
      *(undefined4 *)(iVar2 + 0x44) = 0;
      *(undefined4 *)(iVar2 + 0x48) = 0;
    }
    else {
      fVar5 = fVar4 - *(float *)(sv_friction._28_4_ + 0x2c) * *(float *)(gpGlobals + 0x10) * fVar4;
      if (fVar5 <= 0.0) {
        fVar5 = 0.0;
      }
      fVar5 = fVar5 / fVar4;
      *(float *)(iVar2 + 0x40) = fVar6 * fVar5;
      *(float *)(iVar2 + 0x44) = fVar1 * fVar5;
      *(float *)(iVar2 + 0x48) = fVar5 * fVar7;
      CheckVelocity(this);
      (**(code **)(*(int *)this + 0x9c))(this,0,0);
    }
    return;
  }
  FullNoClipMove(this,*(float *)(sv_specspeed._28_4_ + 0x2c),
                 *(float *)(sv_specaccelerate._28_4_ + 0x2c));
  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)