Silence debug prints and logging
This commit is contained in:
parent
f92b9bc60e
commit
b57fda9f01
|
@ -37,7 +37,7 @@ function mod.attach_driver(cart, player)
|
||||||
-- Update player information
|
-- Update player information
|
||||||
local uuid = staticdata.uuid
|
local uuid = staticdata.uuid
|
||||||
mcl_player.player_attached[player_name] = true
|
mcl_player.player_attached[player_name] = true
|
||||||
minetest.log("action", player_name.." entered minecart #"..tostring(uuid).." at "..tostring(cart._start_pos))
|
--minetest.log("action", player_name.." entered minecart #"..tostring(uuid).." at "..tostring(cart._start_pos))
|
||||||
|
|
||||||
-- Attach the player object to the minecart
|
-- Attach the player object to the minecart
|
||||||
player:set_attach(cart.object, "", vector.new(1,-1.75,-2), vector.new(0,0,0))
|
player:set_attach(cart.object, "", vector.new(1,-1.75,-2), vector.new(0,0,0))
|
||||||
|
|
|
@ -11,7 +11,7 @@ local function force_get_node(pos)
|
||||||
local node = minetest.get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
if node.name ~= "ignore" then return node end
|
if node.name ~= "ignore" then return node end
|
||||||
|
|
||||||
local time_start = minetest.get_us_time()
|
--local time_start = minetest.get_us_time()
|
||||||
local vm = minetest.get_voxel_manip()
|
local vm = minetest.get_voxel_manip()
|
||||||
local emin, emax = vm:read_from_map(pos, pos)
|
local emin, emax = vm:read_from_map(pos, pos)
|
||||||
local area = VoxelArea:new{
|
local area = VoxelArea:new{
|
||||||
|
@ -23,7 +23,7 @@ local function force_get_node(pos)
|
||||||
local param2_data = vm:get_param2_data()
|
local param2_data = vm:get_param2_data()
|
||||||
|
|
||||||
local vi = area:indexp(pos)
|
local vi = area:indexp(pos)
|
||||||
minetest.log("force_get_node() voxel_manip section took "..((minetest.get_us_time()-time_start)*1e-6).." seconds")
|
--minetest.log("force_get_node() voxel_manip section took "..((minetest.get_us_time()-time_start)*1e-6).." seconds")
|
||||||
return {
|
return {
|
||||||
name = minetest.get_name_from_content_id(data[vi]),
|
name = minetest.get_name_from_content_id(data[vi]),
|
||||||
param = param_data[vi],
|
param = param_data[vi],
|
||||||
|
|
|
@ -166,7 +166,7 @@ local function handle_cart_collision(cart1_staticdata, prev_pos, next_dir)
|
||||||
-- Don't collide with the train car in front of you
|
-- Don't collide with the train car in front of you
|
||||||
if cart1_staticdata.ahead == cart_uuid then return end
|
if cart1_staticdata.ahead == cart_uuid then return end
|
||||||
|
|
||||||
minetest.log("action","cart #"..cart1_staticdata.uuid.." collided with cart #"..cart_uuid.." at "..tostring(pos))
|
--minetest.log("action","cart #"..cart1_staticdata.uuid.." collided with cart #"..cart_uuid.." at "..tostring(pos))
|
||||||
|
|
||||||
-- Standard Collision Handling
|
-- Standard Collision Handling
|
||||||
local cart2_staticdata = get_cart_data(cart_uuid)
|
local cart2_staticdata = get_cart_data(cart_uuid)
|
||||||
|
@ -549,7 +549,7 @@ local function do_detached_movement(self, dtime)
|
||||||
-- Use vector projection to only keep the velocity in the new direction of movement on the rail
|
-- Use vector projection to only keep the velocity in the new direction of movement on the rail
|
||||||
-- https://en.wikipedia.org/wiki/Vector_projection
|
-- https://en.wikipedia.org/wiki/Vector_projection
|
||||||
staticdata.velocity = vector.dot(staticdata.dir,freebody_velocity)
|
staticdata.velocity = vector.dot(staticdata.dir,freebody_velocity)
|
||||||
print("Reattached velocity="..tostring(staticdata.velocity)..", freebody_velocity="..tostring(freebody_velocity))
|
--print("Reattached velocity="..tostring(staticdata.velocity)..", freebody_velocity="..tostring(freebody_velocity))
|
||||||
|
|
||||||
-- Clear freebody movement
|
-- Clear freebody movement
|
||||||
self.object:set_velocity(vector.zero())
|
self.object:set_velocity(vector.zero())
|
||||||
|
|
Loading…
Reference in New Issue