From cc293e95fe4d9d2df36a2b6eff8db16f68538797 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Tue, 26 Nov 2019 19:40:25 +0100 Subject: [PATCH] Fix model animations after detach, remove README.txt --- README.txt | 57 --------------------------------------------------- functions.lua | 5 +++-- 2 files changed, 3 insertions(+), 59 deletions(-) delete mode 100644 README.txt diff --git a/README.txt b/README.txt deleted file mode 100644 index 994a6ef..0000000 --- a/README.txt +++ /dev/null @@ -1,57 +0,0 @@ - Minetest mod: boost_cart -========================== -Based on (and fully compatible with) the mod "carts" by PilzAdam -and the one contained in the subgame "minetest_game". -Target: Run smoothly as possible, even on laggy servers. - - - Features ----------- -- A fast cart for your railway or roller coaster -- Easily configurable cart speed using the Advanced Settings -- Boost and brake rails -- By mesecons controlled Start-Stop rails -- Detector rails that send a mesecons signal when the cart drives over them -- Rail junction switching with the 'right/left' walking keys -- Handbrake with the 'back' key -- Support for non-minetest_game subgames - - - Settings ----------- -This mod can be adjusted to fit the conditions of a player or server. -Use the Advanced Settings dialog in the main menu or tune your -minetest.conf file manually: - -boost_cart.speed_max = 10 - ^ Possible values: 1 ... 100 - ^ Maximal speed of the cart in m/s - -boost_cart.punch_speed_max = 7 - ^ Possible values: -1 ... 100 - ^ Maximal speed to which the driving player can accelerate the cart - by punching from inside the cart. -1 will disable this feature. - - - License for everything ------------------------- -CC-0, if not specified otherwise below - - - Authors ---------- -Various authors - carts_rail_*.png - -kddekadenz - cart_bottom.png - cart_side.png - cart_top.png - -klankbeeld (CC-BY 3.0) - http://freesound.org/people/klankbeeld/sounds/174042/ - cart_rail.*.ogg - -Zeg9 - cart.x - cart.png \ No newline at end of file diff --git a/functions.lua b/functions.lua index 870f5fd..77d2dde 100644 --- a/functions.lua +++ b/functions.lua @@ -13,12 +13,13 @@ function boost_cart:manage_attachment(player, obj) local wants_attach = obj ~= nil local attached = player:get_attach() ~= nil - local player_name = player:get_player_name() - boost_cart.player_attached[player_name] = attached or wants_attach if attached == wants_attach then return end + local player_name = player:get_player_name() + boost_cart.player_attached[player_name] = wants_attach + if wants_attach then player:set_attach(obj, "", {x=0, y=-4, z=0}, {x=0, y=0, z=0}) player:set_eye_offset({x=0, y=-4, z=0},{x=0, y=-4, z=0})