OtherChen
The other one
I'm trying to make something hover close to the ground/water without touching it. Ground is easy: (thing.z - thing.floorz). For water, (thing.z - thing.watertop) doesn't work unless the object is underwater, so I'm spawning a "sinker" dummy mobj on the floor under the object and checking its properties. I've tried the following methods:
This shouldn't be so difficult. What am I missing? Is there a parallel to mobj.watertop that checks for water below an object rather than the surface above the object?
- Reading the sinker's eflags doesn't work, as (sinker.eflags & MFE_UNDERWATER) always returns false.
- Reading the sinker's watertop always gives INT32_MAX, so (sinker.watertop > sinker.z) always returns true.
- Using different mobj types for the dummy: thok trails, water splishes, fire, rings, red rings, and crawlas. I left the sprites showing and the objects are clearly underwater.
- Changing the dummy's scale and height to various values, including FRACUNIT, 1, and 0.
- Waiting a few tics and checking the underwater-ness of dummy mobjs from a few tics ago gives the same result
This shouldn't be so difficult. What am I missing? Is there a parallel to mobj.watertop that checks for water below an object rather than the surface above the object?