L L4D2node

CGameMovement::CheckWater

0x0045a2f0 · 748 bytes · __thiscall

_ZN13CGameMovement10CheckWaterEv

Decompiled

undefined (1 param)

/* CGameMovement::CheckWater() */

bool __thiscall CGameMovement::CheckWater(CGameMovement *this)

{
  float fVar1;
  uint uVar2;
  byte bVar3;
  CBaseEntity *this_00;
  int *piVar4;
  float fVar5;
  float fVar6;
  float fVar7;
  float fVar8;
  Vector local_28 [24];
  
  (**(code **)(*(int *)this + 200))(this,1,local_28);
  this_00 = *(CBaseEntity **)(this + 4);
  if (this_00[0x253] != (CBaseEntity)0x0) {
    (**(code **)(*(int *)this_00 + 0x2ec))(this_00,this_00 + 0x253);
    this_00[0x253] = (CBaseEntity)0x0;
    this_00 = *(CBaseEntity **)(this + 4);
  }
  CBaseEntity::SetWaterType(this_00,0);
  uVar2 = GetWaterContentsForPointCached(this,local_28,0);
  if ((uVar2 & 0x4030) != 0) {
    CBaseEntity::SetWaterType(*(CBaseEntity **)(this + 4),uVar2);
    piVar4 = *(int **)(this + 4);
    if (*(char *)((int)piVar4 + 0x253) != '\x01') {
      (**(code **)(*piVar4 + 0x2ec))(piVar4,(int)piVar4 + 0x253);
      *(undefined1 *)((int)piVar4 + 0x253) = 1;
    }
    (**(code **)(*(int *)this + 200))(this,2,local_28);
    uVar2 = GetWaterContentsForPointCached(this,local_28,1);
    piVar4 = *(int **)(this + 4);
    if ((uVar2 & 0x4030) == 0) {
LAB_0045a4a0:
      bVar3 = *(byte *)((int)piVar4 + 0x253);
    }
    else {
      if (*(char *)((int)piVar4 + 0x253) != '\x02') {
        (**(code **)(*piVar4 + 0x2ec))(piVar4,(int)piVar4 + 0x253);
        *(undefined1 *)((int)piVar4 + 0x253) = 2;
      }
      (**(code **)(*(int *)this + 200))(this,3,local_28);
      uVar2 = GetWaterContentsForPointCached(this,local_28,2);
      piVar4 = *(int **)(this + 4);
      if ((uVar2 & 0x4030) == 0) goto LAB_0045a4a0;
      bVar3 = 3;
      if (*(char *)((int)piVar4 + 0x253) != '\x03') {
        (**(code **)(*piVar4 + 0x2ec))(piVar4,(int)piVar4 + 0x253);
        *(undefined1 *)((int)piVar4 + 0x253) = 3;
        piVar4 = *(int **)(this + 4);
        bVar3 = *(byte *)((int)piVar4 + 0x253);
      }
    }
    if ((uVar2 & 0xbc0000) == 0) goto LAB_0045a35b;
    fVar5 = 1.0;
    if ((uVar2 & 0x40000) == 0) {
      fVar5 = 0.0;
    }
    fVar8 = 1.0;
    if ((uVar2 & 0x80000) == 0) {
      fVar8 = 0.0;
    }
    if ((uVar2 & 0x100000) != 0) {
      fVar5 = fVar5 - 1.0;
    }
    if ((uVar2 & 0x200000) != 0) {
      fVar8 = fVar8 - 1.0;
    }
    fVar7 = 1.0;
    if ((uVar2 & 0x400000) == 0) {
      fVar7 = 0.0;
    }
    if ((uVar2 & 0x800000) != 0) {
      fVar7 = fVar7 - 1.0;
    }
    fVar1 = (float)bVar3 * 50.0;
    fVar5 = fVar5 * fVar1 + (float)piVar4[0x9a];
    fVar6 = fVar8 * fVar1 + (float)piVar4[0x9b];
    fVar8 = fVar1 * fVar7 + (float)piVar4[0x9c];
    if ((((float)piVar4[0x9a] == fVar5) && ((float)piVar4[0x9b] == fVar6)) &&
       ((float)piVar4[0x9c] == fVar8)) goto LAB_0045a35b;
    (**(code **)(*piVar4 + 0x2fc))(piVar4,piVar4 + 0x9a);
    piVar4[0x9a] = (int)fVar5;
    piVar4[0x9b] = (int)fVar6;
    piVar4[0x9c] = (int)fVar8;
  }
  piVar4 = *(int **)(this + 4);
  bVar3 = *(byte *)((int)piVar4 + 0x253);
LAB_0045a35b:
  if ((*(int *)(this + 0xc) == 0) && (bVar3 != 0)) {
    *(undefined4 *)(this + 0x10) = *(undefined4 *)(gpGlobals + 0xc);
    bVar3 = *(byte *)((int)piVar4 + 0x253);
  }
  return 1 < bVar3;
}

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)