forked from mtcontrib/boost_cart
Merge remote-tracking branch 'upstream/master' into nalc-1.2-dev
This commit is contained in:
commit
d3a0b0e2c2
@ -12,6 +12,7 @@ Target: Run smoothly as possible, even on laggy servers.
|
|||||||
- Rail junction switching with the 'right/left' walking keys
|
- Rail junction switching with the 'right/left' walking keys
|
||||||
- Handbrake with the 'back' key
|
- Handbrake with the 'back' key
|
||||||
- Support for non-minetest_game subgames
|
- Support for non-minetest_game subgames
|
||||||
|
- Descend from cart using the `sneak` key
|
||||||
|
|
||||||
## Settings
|
## 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
|
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
|
||||||
|
@ -95,6 +95,7 @@ end
|
|||||||
function cart_entity:on_detach_child(child)
|
function cart_entity:on_detach_child(child)
|
||||||
if child and child:get_player_name() == self.driver then
|
if child and child:get_player_name() == self.driver then
|
||||||
self.driver = nil
|
self.driver = nil
|
||||||
|
boost_cart:manage_attachment(child, nil)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -303,6 +304,12 @@ function cart_entity:on_step(dtime)
|
|||||||
acc = -0.4
|
acc = -0.4
|
||||||
end
|
end
|
||||||
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
|
if acc then
|
||||||
-- Slow down or speed up, depending on Y direction
|
-- Slow down or speed up, depending on Y direction
|
||||||
@ -339,10 +346,13 @@ function cart_entity:on_step(dtime)
|
|||||||
if self.punched then
|
if self.punched then
|
||||||
-- Collect dropped items
|
-- Collect dropped items
|
||||||
for _, obj_ in pairs(minetest.get_objects_inside_radius(pos, 1)) do
|
for _, obj_ in pairs(minetest.get_objects_inside_radius(pos, 1)) do
|
||||||
if not obj_:is_player() and
|
local ent = obj_:get_luaentity()
|
||||||
obj_:get_luaentity() and
|
-- Careful here: physical_state and disable_physics are item-internal APIs
|
||||||
not obj_:get_luaentity().physical_state and
|
if ent and ent.name == "__builtin:item" and ent.physical_state then
|
||||||
obj_:get_luaentity().name == "__builtin:item" then
|
-- Check API to support 5.2.0 and older
|
||||||
|
if ent.disable_physics then
|
||||||
|
ent:disable_physics()
|
||||||
|
end
|
||||||
|
|
||||||
obj_:set_attach(self.object, "", {x=0, y=0, z=0}, {x=0, y=0, z=0})
|
obj_:set_attach(self.object, "", {x=0, y=0, z=0}, {x=0, y=0, z=0})
|
||||||
self.attached_items[#self.attached_items + 1] = obj_
|
self.attached_items[#self.attached_items + 1] = obj_
|
||||||
|
Loading…
x
Reference in New Issue
Block a user