Aaron Suen c6cf1f9cb6 Players float when idle in water
This is done rather hackishly, but Minetest doesn't
seem to offer a sane way to register fluid buoyancy, or
even a reasonable hack to use negative gravity for this.
Instead, just push player upward with velocity impulses
every so often.

This is helpful gameplay-wise to make chatting while
swimming easier for players not using auto-forward, or
to prevent players from drowning and losing their stuff
while swimming long-distance and dropping network
connection and their in-game character waiting in the
water for the timeout.  Instead, players will return to the
surface and remain where they can breathe until the
player can take control again.
2020-05-18 20:49:30 -04:00

12 lines
297 B
Lua

-- LUALOCALS < ---------------------------------------------------------
local include, nodecore
= include, nodecore
-- LUALOCALS > ---------------------------------------------------------
nodecore.amcoremod()
include("setup")
include("hotpotato")
include("globalstep")
include("buoyancy")