aboutsummaryrefslogtreecommitdiff
path: root/trainlogic.lua
diff options
context:
space:
mode:
authororwell96 <mono96.mml@gmail.com>2016-05-30 19:59:13 +0200
committerorwell96 <mono96.mml@gmail.com>2016-05-30 19:59:13 +0200
commit054a7b188e78d1afd1de218ad6f5433f7c5d58e2 (patch)
treebf686fb9f03676d880d12f2d2a7c1ce8d406fdaf /trainlogic.lua
parentd81509c049f8c0a46e9002af7ce4666f4284111b (diff)
downloadadvtrains-054a7b188e78d1afd1de218ad6f5433f7c5d58e2.tar.gz
advtrains-054a7b188e78d1afd1de218ad6f5433f7c5d58e2.tar.bz2
advtrains-054a7b188e78d1afd1de218ad6f5433f7c5d58e2.zip
removed debug messages
Diffstat (limited to 'trainlogic.lua')
-rw-r--r--trainlogic.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/trainlogic.lua b/trainlogic.lua
index d12dfa2..6bd8310 100644
--- a/trainlogic.lua
+++ b/trainlogic.lua
@@ -186,14 +186,14 @@ function advtrains.train_step(id, train, dtime)
train.check_trainpartload=(train.check_trainpartload or 0)-dtime
local node_range=(math.max((minetest.setting_get("active_block_range") or 0),1)*16)
if train.check_trainpartload<=0 and posfront and posback then
- print(minetest.pos_to_string(posfront))
+ --print(minetest.pos_to_string(posfront))
local should_check=false
for _,p in ipairs(minetest.get_connected_players()) do
should_check=should_check or ((vector.distance(posfront, p:getpos())<node_range) and (vector.distance(posback, p:getpos())<node_range))
end
if should_check then
--it is better to iterate luaentites only once
- print("check_trainpartload")
+ --print("check_trainpartload")
local found_uids={}
for _,wagon in pairs(minetest.luaentities) do
if wagon.is_wagon and wagon.initialized and wagon.train_id==id then
@@ -205,13 +205,13 @@ function advtrains.train_step(id, train, dtime)
end
end
end
- print("found_uids: "..dump(found_uids))
+ --print("found_uids: "..dump(found_uids))
--now iterate trainparts and check. then cross them out to see if there are wagons over for any reason
for pit, w_id in ipairs(train.trainparts) do
if found_uids[w_id] then
- print(w_id.." still loaded")
+ --print(w_id.." still loaded")
elseif advtrains.wagon_save[w_id] then
- print(w_id.." not loaded, but save available")
+ --print(w_id.." not loaded, but save available")
--spawn a new and initialize it with the properties from wagon_save
local le=minetest.env:add_entity(posfront, advtrains.wagon_save[w_id].entity_name):get_luaentity()
for k,v in pairs(advtrains.wagon_save[w_id]) do