From 5b5318338153ece8846ed6089c9ee49d11283213 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Sat, 30 May 2020 09:08:54 +0200 Subject: [PATCH] Descend from cart using sneak (#31) --- README.md | 1 + cart_entity.lua | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 8b7324f..765d505 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ Target: Run smoothly as possible, even on laggy servers. - Rail junction switching with the 'right/left' walking keys - Handbrake with the 'back' key - Support for non-minetest_game subgames +- Descend from cart using the `sneak` key ## Settings This mod can be adjusted to fit the preference of a player or server. Use the `Settings -> All Settings` dialog in the main menu or tune your diff --git a/cart_entity.lua b/cart_entity.lua index 9cc5324..a30885c 100644 --- a/cart_entity.lua +++ b/cart_entity.lua @@ -304,6 +304,12 @@ function cart_entity:on_step(dtime) acc = -0.4 end end + if ctrl and ctrl.sneak then + -- Descend when sneak is pressed + boost_cart:manage_attachment(player, nil) + player = nil + ctrl = nil + end if acc then -- Slow down or speed up, depending on Y direction