L L4D2node

CGameMovement::WaterMove

0x00452d80 · 1633 bytes · __thiscall

_ZN13CGameMovement9WaterMoveEv

Decompiled

undefined (1 param)

/* CGameMovement::WaterMove() */

void __thiscall CGameMovement::WaterMove(CGameMovement *this)

{
  float *pfVar1;
  int iVar2;
  code *pcVar3;
  int iVar4;
  char cVar5;
  int iVar6;
  undefined4 uVar7;
  longdouble lVar8;
  float fVar9;
  float fVar10;
  float fVar11;
  float local_d0 [3];
  float local_c4;
  float local_c0;
  float local_bc;
  float local_b8;
  float local_b4;
  float local_b0;
  float local_ac;
  float local_a8;
  float local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  float local_94;
  float local_90;
  float local_8c;
  float local_88;
  float local_84;
  float local_80;
  Vector local_7c [12];
  undefined1 local_70 [12];
  undefined4 local_64;
  undefined4 local_60;
  float local_5c;
  float local_44;
  char local_3a;
  char local_39;
  
  AngleVectors((QAngle *)(*(int *)(this + 8) + 0xc),(Vector *)&local_94,(Vector *)&local_88,local_7c
              );
  iVar6 = *(int *)(this + 8);
  local_d0[0] = local_94 * *(float *)(iVar6 + 0x2c) + local_88 * *(float *)(iVar6 + 0x30);
  local_d0[1] = local_90 * *(float *)(iVar6 + 0x2c) + local_84 * *(float *)(iVar6 + 0x30);
  local_d0[2] = local_80 * *(float *)(iVar6 + 0x30) + local_8c * *(float *)(iVar6 + 0x2c);
  if ((*(byte *)(iVar6 + 0x24) & 2) != 0) {
    cVar5 = (**(code **)(*(int *)this + 0x58))(this);
    iVar6 = *(int *)(this + 8);
    if (cVar5 != '\0') {
      local_d0[2] = *(float *)(iVar6 + 0x3c) + local_d0[2];
      goto LAB_00452e7c;
    }
  }
  if ((((*(float *)(iVar6 + 0x2c) == 0.0) && (*(float *)(iVar6 + 0x30) == 0.0)) &&
      (*(float *)(iVar6 + 0x34) == 0.0)) ||
     (cVar5 = (**(code **)(*(int *)this + 0x58))(this), cVar5 == '\0')) {
    iVar6 = CBaseEntity::GetGroundEntity(*(CBaseEntity **)(this + 4));
    if (iVar6 == 0) {
      local_d0[2] = -60.0;
    }
  }
  else {
    cVar5 = (**(code **)(*(int *)this + 0x58))(this);
    if (cVar5 != '\0') {
      iVar6 = *(int *)(this + 8);
      local_8c = *(float *)(iVar6 + 0x2c) * local_8c;
      local_8c = local_8c + local_8c;
      fVar9 = *(float *)(iVar6 + 0x3c);
      if ((local_8c <= *(float *)(iVar6 + 0x3c)) && (fVar9 = 0.0, 0.0 <= local_8c)) {
        fVar9 = local_8c;
      }
      local_d0[2] = *(float *)(iVar6 + 0x34) + local_d0[2] + fVar9;
    }
  }
LAB_00452e7c:
  local_c4 = local_d0[0];
  local_c0 = local_d0[1];
  local_bc = local_d0[2];
  lVar8 = (longdouble)VectorNormalize((Vector *)&local_c4);
  iVar6 = *(int *)(this + 8);
  fVar11 = (float)lVar8;
  fVar9 = *(float *)(iVar6 + 0x38);
  if (fVar9 < fVar11) {
    fVar11 = fVar9 / fVar11;
    local_d0[0] = local_d0[0] * fVar11;
    local_d0[2] = fVar11 * local_d0[2];
    local_d0[1] = local_d0[1] * fVar11;
    fVar11 = fVar9;
  }
  fVar11 = fVar11 * 0.8;
  local_a0 = *(undefined4 *)(iVar6 + 0x40);
  local_9c = *(undefined4 *)(iVar6 + 0x44);
  local_98 = *(undefined4 *)(iVar6 + 0x48);
  lVar8 = (longdouble)VectorNormalize((Vector *)&local_a0);
  fVar10 = 0.0;
  fVar9 = (float)lVar8;
  if (fVar9 != 0.0) {
    iVar6 = *(int *)(this + 8);
    fVar10 = fVar9 - *(float *)(*(int *)(this + 4) + 0x2180) * *(float *)(gpGlobals + 0x10) *
                     *(float *)(sv_friction._28_4_ + 0x2c) * fVar9;
    fVar10 = (float)((uint)fVar10 & -(uint)(0.1 <= fVar10));
    fVar9 = fVar10 / fVar9;
    *(float *)(iVar6 + 0x40) = *(float *)(iVar6 + 0x40) * fVar9;
    *(float *)(iVar6 + 0x44) = *(float *)(iVar6 + 0x44) * fVar9;
    *(float *)(iVar6 + 0x48) = fVar9 * *(float *)(iVar6 + 0x48);
  }
  if ((0.1 <= fVar11) && (fVar10 = fVar11 - fVar10, 0.0 < fVar10)) {
    VectorNormalize((Vector *)local_d0);
    iVar6 = 0;
    fVar11 = *(float *)(*(int *)(this + 4) + 0x2180) * *(float *)(gpGlobals + 0x10) *
             *(float *)(sv_accelerate._28_4_ + 0x2c) * fVar11;
    if (fVar10 <= fVar11) {
      fVar11 = fVar10;
    }
    do {
      fVar9 = *(float *)((Vector *)local_d0 + iVar6) * fVar11;
      pfVar1 = (float *)(*(int *)(this + 8) + 0x40 + iVar6);
      *pfVar1 = *pfVar1 + fVar9;
      pfVar1 = (float *)(*(int *)(this + 8) + 0x68 + iVar6);
      iVar6 = iVar6 + 4;
      *pfVar1 = fVar9 + *pfVar1;
    } while (iVar6 != 0xc);
  }
  iVar6 = *(int *)(this + 8);
  iVar2 = *(int *)(this + 4);
  *(float *)(iVar6 + 0x40) = *(float *)(iVar6 + 0x40) + *(float *)(iVar2 + 0x268);
  *(float *)(iVar6 + 0x44) = *(float *)(iVar6 + 0x44) + *(float *)(iVar2 + 0x26c);
  iVar4 = gpGlobals;
  *(float *)(iVar6 + 0x48) = *(float *)(iVar6 + 0x48) + *(float *)(iVar2 + 0x270);
  iVar6 = *(int *)(this + 8);
  fVar9 = *(float *)(iVar4 + 0x10);
  local_ac = *(float *)(iVar6 + 0x40) * fVar9 + *(float *)(iVar6 + 0x9c);
  local_a8 = *(float *)(iVar6 + 0x44) * fVar9 + *(float *)(iVar6 + 0xa0);
  local_a4 = fVar9 * *(float *)(iVar6 + 0x48) + *(float *)(iVar6 + 0xa4);
  pcVar3 = *(code **)(*(int *)this + 0x3c);
  uVar7 = (**(code **)(*(int *)this + 0x40))(this,0,0);
  (*pcVar3)(this,*(int *)(this + 8) + 0x9c,&local_ac,uVar7,8,local_70);
  if (local_44 == 1.0) {
    local_b8 = local_ac;
    local_b4 = local_a8;
    local_b0 = local_a4;
    if (*(char *)(*(int *)(this + 4) + 0x1ad0) != '\0') {
      local_b0 = local_a4 + 1.0 + *(float *)(*(int *)(this + 4) + 0x1acc);
    }
    pcVar3 = *(code **)(*(int *)this + 0x3c);
    uVar7 = (**(code **)(*(int *)this + 0x40))(this,0,0);
    (*pcVar3)(this,&local_b8,&local_ac,uVar7,8,local_70);
    if ((local_39 == '\0') && (local_3a == '\0')) {
      iVar6 = *(int *)(this + 8);
      *(float *)(iVar6 + 100) = (*(float *)(iVar6 + 100) + local_5c) - *(float *)(iVar6 + 0xa4);
      iVar6 = *(int *)(this + 8);
      *(undefined4 *)(iVar6 + 0x9c) = local_64;
      *(float *)(iVar6 + 0xa4) = local_5c;
      *(undefined4 *)(iVar6 + 0xa0) = local_60;
    }
    else {
      (**(code **)(*(int *)this + 0x9c))(this,0,0);
    }
  }
  else {
    iVar6 = CBaseEntity::GetGroundEntity(*(CBaseEntity **)(this + 4));
    if (iVar6 == 0) {
      (**(code **)(*(int *)this + 0x9c))(this,0,0);
    }
    else {
      (**(code **)(*(int *)this + 0x104))(this,&local_ac,local_70);
    }
  }
  iVar6 = *(int *)(this + 8);
  iVar2 = *(int *)(this + 4);
  *(float *)(iVar6 + 0x40) = *(float *)(iVar6 + 0x40) - *(float *)(iVar2 + 0x268);
  *(float *)(iVar6 + 0x44) = *(float *)(iVar6 + 0x44) - *(float *)(iVar2 + 0x26c);
  *(float *)(iVar6 + 0x48) = *(float *)(iVar6 + 0x48) - *(float *)(iVar2 + 0x270);
  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)