L L4D2node

CGameMovement::GetWaterContentsForPointCached

0x0045a1b0 · 291 bytes · __thiscall

_ZN13CGameMovement30GetWaterContentsForPointCachedERK6Vectori

Decompiled

undefined (3 params)

/* CGameMovement::GetWaterContentsForPointCached(Vector const&, int) */

int __thiscall
CGameMovement::GetWaterContentsForPointCached(CGameMovement *this,Vector *param_1,int param_2)

{
  int iVar1;
  int iVar2;
  undefined4 uVar3;
  int iVar4;
  CGameMovement *pCVar5;
  
  if (g_bMovementOptimizations == '\0') {
                    /* WARNING: Could not recover jumptable at 0x0045a2b6. Too many branches */
                    /* WARNING: Treating indirect jump as call */
    iVar4 = (**(code **)(*enginetrace + 4))();
    return iVar4;
  }
  if (*(int *)(*(int *)(this + 4) + 0x30) == 0) {
    iVar4 = -1;
  }
  else {
    iVar4 = (*(int *)(*(int *)(this + 4) + 0x30) - *(int *)(gpGlobals + 0x58) >> 4) + -1;
  }
  iVar2 = iVar4 * 3 + param_2;
  if (*(int *)(this + iVar2 * 4 + 0x3c) == -9999) {
    iVar4 = iVar4 * 0x24 + 0x1bc + param_2 * 0xc;
  }
  else {
    iVar1 = iVar4 * 0x24 + 0x1b0 + param_2 * 0xc;
    iVar4 = iVar1 + 0xc;
    if ((*(float *)param_1 - *(float *)(this + iVar1 + 0xc)) *
        (*(float *)param_1 - *(float *)(this + iVar1 + 0xc)) +
        (*(float *)(param_1 + 4) - *(float *)(this + iVar1 + 0x10)) *
        (*(float *)(param_1 + 4) - *(float *)(this + iVar1 + 0x10)) +
        (*(float *)(param_1 + 8) - *(float *)(this + iVar1 + 0x14)) *
        (*(float *)(param_1 + 8) - *(float *)(this + iVar1 + 0x14)) <= 1.0) {
      return *(int *)(this + iVar2 * 4 + 0x3c);
    }
  }
  pCVar5 = this + iVar4;
  uVar3 = (**(code **)(*enginetrace + 4))(enginetrace,param_1,0x4030);
  *(undefined4 *)(this + iVar2 * 4 + 0x3c) = uVar3;
  *(undefined4 *)pCVar5 = *(undefined4 *)param_1;
  *(undefined4 *)(pCVar5 + 4) = *(undefined4 *)(param_1 + 4);
  *(undefined4 *)(pCVar5 + 8) = *(undefined4 *)(param_1 + 8);
  return *(int *)(this + iVar2 * 4 + 0x3c);
}

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)