aboutsummaryrefslogtreecommitdiff
path: root/advtrains/wagons.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-05-29 12:34:01 +0200
committerorwell96 <orwell@bleipb.de>2018-06-14 17:39:42 +0200
commit521112aced4e06f8fb59c9dfe8d0e082da858eb1 (patch)
tree33fd08516180d22a464471359cd5492e495835a2 /advtrains/wagons.lua
parent2a76d4a960aa29621dc8020f84eee241b41e10c0 (diff)
downloadadvtrains-521112aced4e06f8fb59c9dfe8d0e082da858eb1.tar.gz
advtrains-521112aced4e06f8fb59c9dfe8d0e082da858eb1.tar.bz2
advtrains-521112aced4e06f8fb59c9dfe8d0e082da858eb1.zip
add option to show train and wagon id
Diffstat (limited to 'advtrains/wagons.lua')
-rw-r--r--advtrains/wagons.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua
index 5a2fffb..87fb7e7 100644
--- a/advtrains/wagons.lua
+++ b/advtrains/wagons.lua
@@ -11,6 +11,8 @@ advtrains.wagons = {}
advtrains.wagon_prototypes = {}
advtrains.wagon_objects = {}
+local setting_show_ids = minetest.settings:get_bool("advtrains_show_ids")
+
--
function advtrains.create_wagon(wtype, owner)
local new_id=advtrains.random_id()
@@ -285,6 +287,9 @@ function wagon:on_step(dtime)
--check infotext
local outside=self:train().text_outside or ""
+ if setting_show_ids then
+ outside = outside .. "\nT:" .. data.train_id .. " W:" .. self.id
+ end
local train=self:train()
--show off-track information in outside text instead of notifying the whole server about this