aboutsummaryrefslogtreecommitdiff
path: root/advtrains/trainlogic.lua
diff options
context:
space:
mode:
authorY. Wang <yw05@forksworld.de>2022-08-22 19:42:06 +0200
committerorwell96 <orwell@bleipb.de>2023-04-12 21:32:32 +0200
commit4f241b06b1cb803099eff4bbc981fca6eb839340 (patch)
tree4fcc73dc0b90cfe6f86ff6d35f592f23cf52cfc7 /advtrains/trainlogic.lua
parent3a6b1ca8500cad74f95b925b191582c0aa739116 (diff)
downloadadvtrains-4f241b06b1cb803099eff4bbc981fca6eb839340.tar.gz
advtrains-4f241b06b1cb803099eff4bbc981fca6eb839340.tar.bz2
advtrains-4f241b06b1cb803099eff4bbc981fca6eb839340.zip
Report coordinates of wagons with unregistered prototypes
Related issue: https://forum.minetest.net/viewtopic.php?p=414307#p414307
Diffstat (limited to 'advtrains/trainlogic.lua')
-rw-r--r--advtrains/trainlogic.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua
index a0fdaa1..288e224 100644
--- a/advtrains/trainlogic.lua
+++ b/advtrains/trainlogic.lua
@@ -1053,7 +1053,16 @@ function advtrains.update_trainpart_properties(train_id, invert_flipstate)
if data then
local wagon = advtrains.wagon_prototypes[data.type or data.entity_name]
if not wagon then
- atwarn("Wagon '",data.type,"' couldn't be found. Please check that all required modules are loaded!")
+ local ent = advtrains.wagon_objects[w_id]
+ local pdesc
+ if ent then
+ pdesc = "at " .. minetest.pos_to_string(ent:get_pos())
+ elseif train.last_pos then
+ pdesc = "near " .. minetest.pos_to_string(train.last_pos)
+ else
+ pdesc = "at an unknown location"
+ end
+ atwarn(string.format("Wagon %q %s could not be found. Please check that all required modules are loaded!", data.type, pdesc))
wagon = advtrains.wagon_prototypes["advtrains:wagon_placeholder"]
end