L L4D2node

CBaseEntity::PhysicsCheckWaterTransition

0x00477030 · 294 bytes · __thiscall

_ZN11CBaseEntity27PhysicsCheckWaterTransitionEv

Decompiled

undefined (1 param)

/* CBaseEntity::PhysicsCheckWaterTransition() */

void __thiscall CBaseEntity::PhysicsCheckWaterTransition(CBaseEntity *this)

{
  uint uVar1;
  int iVar2;
  uint uVar3;
  undefined *puVar4;
  undefined4 local_28;
  undefined4 local_24;
  float local_20;
  
  iVar2 = GetWaterType(this);
  UpdateWaterState(this);
  uVar3 = GetWaterType(this);
  uVar1 = *(uint *)(this + 0x188);
  if ((((uVar1 == 0xffffffff) ||
       (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar4 + 8) != uVar1 >> 0xc)) || (*(int *)(puVar4 + 4) == 0)) {
    if ((uVar3 & 0x4030) == 0) {
      if (iVar2 != 0) {
        EmitSound(this,"BaseEntity.ExitWater",0.0,(float *)0x0);
      }
    }
    else if (iVar2 == 0) {
      (**(code **)(*(int *)this + 0x284))(this);
      EmitSound(this,"BaseEntity.EnterWater",0.0,(float *)0x0);
      if ((*(uint *)(this + 0x14c) & 0x20000000) == 0) {
        if ((*(uint *)(this + 0x14c) & 0x1000) != 0) {
          CalcAbsoluteVelocity(this);
        }
        local_28 = *(undefined4 *)(this + 0x274);
        local_24 = *(undefined4 *)(this + 0x278);
        local_20 = *(float *)(this + 0x27c) * 0.5;
        SetAbsVelocity(this,(Vector *)&local_28);
      }
    }
  }
  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)