Can't force pw_underwater while not in water?

I was trying to make an always underwater script for personal use but I've noticed that no matter what I seem to do, the game always ignores the changes when I'm on land.

Here's the Script:
addHook("ThinkFrame", do
    for player in players.iterate
        if (player.mo and player.mo.valid)
            CONS_Printf(player, player.powers[pw_underwater])
            if (player.powers[pw_underwater] == 0)
            and not (player.powers[pw_underwater] >= 1 and (player.powers[pw_underwater] <= 1050))
                player.powers[pw_underwater] = 1050
            end
        end
    end
end)

I'm using CONS_Printf to tell me if the script is working or not, and it seems to work only when in a body of water (go figure). On level start, it gets set to 0 and never changes until I enter water.
Removing everything other than "player.powers[pw_underwater] = 1050" will lock the player's drowning timer at 1049 when entering a body of water.
 
Can't you just put the MFE_UNDERWATER flag? Idk if that would work but I can't check rn. (And you did say that you will be like underwater even on land?)
 

Who is viewing this thread (Total: 0, Members: 0, Guests: 0)

Back
Top