L L4D2node

CBaseEntity::PhysicsCheckWater

0x00476ac0 · 387 bytes · __thiscall

_ZN11CBaseEntity17PhysicsCheckWaterEv

Decompiled

undefined (1 param)

/* CBaseEntity::PhysicsCheckWater() */

bool __thiscall CBaseEntity::PhysicsCheckWater(CBaseEntity *this)

{
  float fVar1;
  CBaseEntity CVar2;
  uint uVar3;
  undefined *puVar4;
  float fVar5;
  float fVar6;
  float fVar7;
  float fVar8;
  
  uVar3 = *(uint *)(this + 0x188);
  if (((((uVar3 == 0xffffffff) ||
        (puVar4 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar4 == (undefined *)0xfffffffc)) ||
       (*(uint *)(puVar4 + 8) != uVar3 >> 0xc)) || (*(int *)(puVar4 + 4) == 0)) &&
     (uVar3 = GetWaterType(this), (uVar3 & 0xbc4030) == 0xbc4030)) {
    fVar5 = 1.0;
    if ((uVar3 & 0x40000) == 0) {
      fVar5 = 0.0;
    }
    fVar8 = 1.0;
    if ((uVar3 & 0x80000) == 0) {
      fVar8 = 0.0;
    }
    if ((uVar3 & 0x100000) != 0) {
      fVar5 = fVar5 - 1.0;
    }
    if ((uVar3 & 0x200000) != 0) {
      fVar8 = fVar8 - 1.0;
    }
    fVar7 = 1.0;
    if ((uVar3 & 0x400000) == 0) {
      fVar7 = 0.0;
    }
    if ((uVar3 & 0x800000) != 0) {
      fVar7 = fVar7 - 1.0;
    }
    CVar2 = this[0x253];
    fVar1 = (float)(byte)CVar2 * 50.0;
    fVar5 = fVar5 * fVar1 + *(float *)(this + 0x268);
    fVar6 = fVar8 * fVar1 + *(float *)(this + 0x26c);
    fVar8 = fVar1 * fVar7 + *(float *)(this + 0x270);
    if (((*(float *)(this + 0x268) == fVar5) && (*(float *)(this + 0x26c) == fVar6)) &&
       (*(float *)(this + 0x270) == fVar8)) goto LAB_00476b16;
    (**(code **)(*(int *)this + 0x2fc))(this,this + 0x268);
    *(float *)(this + 0x268) = fVar5;
    *(float *)(this + 0x26c) = fVar6;
    *(float *)(this + 0x270) = fVar8;
  }
  CVar2 = this[0x253];
LAB_00476b16:
  return 1 < (byte)CVar2;
}

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)