From d19eecee77fb6bd7e0d79b1463f5178d23c14027 Mon Sep 17 00:00:00 2001 From: MoNTE48 Date: Sat, 7 Mar 2020 10:23:10 +0100 Subject: [PATCH] Check for movement when trying to sit --- init.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 8d6f896..1d981a8 100755 --- a/init.lua +++ b/init.lua @@ -13,6 +13,9 @@ if ts_furniture.enable_sitting then ts_furniture.sit = function(pos, _, player) local name = player:get_player_name() if not player_api.player_attached[name] then + if vector.length(player:get_player_velocity()) > 0 then + return + end player:move_to(pos) player:set_eye_offset({x = 0, y = -7, z = 2}, {x = 0, y = 0, z = 0}) player:set_physics_override(0, 0, 0) @@ -144,7 +147,7 @@ local ignore_groups = { ["stone"] = true } -function ts_furniture.register_furniture(recipe, description, texture) +function ts_furniture.register_furniture(recipe, description, tiles) local recipe_def = minetest.registered_items[recipe] if not recipe_def then return @@ -171,7 +174,7 @@ function ts_furniture.register_furniture(recipe, description, texture) paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, - tiles = { texture }, + tiles = { tiles }, groups = groups, node_box = { type = "fixed",