mirror of
https://github.com/SmallJoker/boost_cart.git
synced 2024-11-30 18:13:44 +01:00
Prevent from getting suck in walls while moving up
This commit is contained in:
parent
159d4ec603
commit
79905e47f4
3
init.lua
3
init.lua
@ -117,9 +117,11 @@ end
|
|||||||
|
|
||||||
function boost_cart.cart:on_step(dtime)
|
function boost_cart.cart:on_step(dtime)
|
||||||
local vel = self.object:getvelocity()
|
local vel = self.object:getvelocity()
|
||||||
|
local update = {}
|
||||||
if self.punched then
|
if self.punched then
|
||||||
vel = vector.add(vel, self.velocity)
|
vel = vector.add(vel, self.velocity)
|
||||||
self.object:setvelocity(vel)
|
self.object:setvelocity(vel)
|
||||||
|
self.old_dir.y = 0
|
||||||
elseif vector.equals(vel, {x=0, y=0, z=0}) then
|
elseif vector.equals(vel, {x=0, y=0, z=0}) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -134,7 +136,6 @@ function boost_cart.cart:on_step(dtime)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local update = {}
|
|
||||||
local ctrl, player = nil, nil
|
local ctrl, player = nil, nil
|
||||||
if self.driver then
|
if self.driver then
|
||||||
player = minetest.get_player_by_name(self.driver)
|
player = minetest.get_player_by_name(self.driver)
|
||||||
|
Loading…
Reference in New Issue
Block a user