L L4D2node

CBaseEntity::UpdateWaterState

0x00476900 · 422 bytes · __thiscall

_ZN11CBaseEntity16UpdateWaterStateEv

Decompiled

undefined (1 param)

/* CBaseEntity::UpdateWaterState() */

void __thiscall CBaseEntity::UpdateWaterState(CBaseEntity *this)

{
  code *pcVar1;
  uint uVar2;
  int iVar3;
  int **ppiVar4;
  int *local_50;
  Vector local_34 [8];
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  ppiVar4 = (int **)&stack0xffffffb4;
  local_28 = 0x3f000000;
  local_24 = 0x3f000000;
  local_20 = 0;
  local_50 = (int *)0x47693d;
  CCollisionProperty::NormalizedToWorldSpace
            ((CCollisionProperty *)(this + 0x194),(Vector *)&local_28,local_34);
  if (this[0x253] != (CBaseEntity)0x0) {
    local_50 = (int *)0x4769a2;
    (**(code **)(*(int *)this + 0x2ec))();
    this[0x253] = (CBaseEntity)0x0;
  }
  local_50 = (int *)0x47695f;
  SetWaterType(this,0);
  local_50 = (int *)0x476978;
  uVar2 = (**(code **)(*enginetrace + 4))();
  if ((uVar2 & 0x4030) == 0) {
    return;
  }
  local_50 = (int *)0x4769bc;
  SetWaterType(this,uVar2);
  if (this[0x253] != (CBaseEntity)0x1) {
    local_50 = (int *)0x4769d7;
    (**(code **)(*(int *)this + 0x2ec))();
    this[0x253] = (CBaseEntity)0x1;
  }
  if (*(float *)(this + 0x1b8) != 0.0) {
    local_50 = (int *)0x476a23;
    iVar3 = (**(code **)(*(int *)this + 0x288))();
    local_2c = *(undefined4 *)(iVar3 + 8);
    local_50 = (int *)0x476a46;
    uVar2 = (**(code **)(*enginetrace + 4))();
    if ((uVar2 & 0x4030) == 0) {
      return;
    }
    if (this[0x253] != (CBaseEntity)0x2) {
      local_50 = (int *)0x476a6c;
      (**(code **)(*(int *)this + 0x2ec))();
      this[0x253] = (CBaseEntity)0x2;
    }
    local_50 = (int *)0x476a82;
    (**(code **)(*(int *)this + 0x234))();
    ppiVar4 = &local_50;
    local_2c = local_20;
    local_50 = enginetrace;
    uVar2 = (**(code **)(*enginetrace + 4))();
    if ((uVar2 & 0x4030) == 0) {
      return;
    }
  }
  if (this[0x253] == (CBaseEntity)0x3) {
    return;
  }
  iVar3 = *(int *)this;
  *ppiVar4 = (int *)this;
  ppiVar4[1] = (int *)(this + 0x253);
  pcVar1 = *(code **)(iVar3 + 0x2ec);
  ppiVar4[-1] = (int *)0x476a05;
  (*pcVar1)();
  this[0x253] = (CBaseEntity)0x3;
  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)