Remove print and other minor improvements

master
Joachim Stolberg 2021-05-02 19:14:14 +02:00
parent bc1d15ba3b
commit 3374f7f7d0
2 changed files with 8 additions and 7 deletions

View File

@ -170,11 +170,13 @@ local function play_sound(self)
self.sound_handle = nil
minetest.after(0.2, minetest.sound_stop, handle)
end
self.sound_handle = minetest.sound_play(
"carts_cart_moving", {
object = self.object,
gain = self.curr_speed / MAX_SPEED,
})
if self.object then
self.sound_handle = minetest.sound_play(
"carts_cart_moving", {
object = self.object,
gain = self.curr_speed / MAX_SPEED,
})
end
end
local function on_step(self, dtime)

View File

@ -17,8 +17,7 @@ local CYCLE_TIME = 4
local function node_timer(pos)
local node = minetest.get_node(pos)
local dir = minetest.facedir_to_dir((node.param2) % 4)
print(minetest.pos_to_string(dir))
local dir = minetest.facedir_to_dir(node.param2)
minecart.punch_cart({x = pos.x, y = pos.y + 1, z = pos.z}, nil, 1, dir)
return true
end