mirror of
https://github.com/APercy/airutils.git
synced 2025-03-21 18:41:21 +00:00
fix to move objects in water
This commit is contained in:
parent
070c8a64b1
commit
ed0b6a4aa8
1 changed files with 2 additions and 1 deletions
|
@ -17,6 +17,7 @@ function airutils.move_target(player, pointed_thing)
|
||||||
local node = minetest.get_node(obj_pos).name
|
local node = minetest.get_node(obj_pos).name
|
||||||
local nodedef = minetest.registered_nodes[node]
|
local nodedef = minetest.registered_nodes[node]
|
||||||
local is_airlike = nodedef.drawtype == "airlike"
|
local is_airlike = nodedef.drawtype == "airlike"
|
||||||
|
local is_liquid = (nodedef.drawtype == "flowingliquid" or nodedef.drawtype == "liquid")
|
||||||
|
|
||||||
if player:get_player_control().sneak == true then
|
if player:get_player_control().sneak == true then
|
||||||
local rotation = object:get_rotation()
|
local rotation = object:get_rotation()
|
||||||
|
@ -25,7 +26,7 @@ function airutils.move_target(player, pointed_thing)
|
||||||
object:set_rotation(rotation)
|
object:set_rotation(rotation)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if is_airlike then object:set_pos(obj_pos) end
|
if is_airlike or is_liquid then object:set_pos(obj_pos) end
|
||||||
end
|
end
|
||||||
--[[if object:get_attach() then
|
--[[if object:get_attach() then
|
||||||
local dir = player:get_look_dir()
|
local dir = player:get_look_dir()
|
||||||
|
|
Loading…
Add table
Reference in a new issue