Skip to content

Commit

Permalink
Descend from cart using sneak (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
SmallJoker committed May 30, 2020
1 parent 56f5b18 commit 5b53183
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions cart_entity.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5b53183

Please sign in to comment.