aboutsummaryrefslogtreecommitdiff
path: root/advtrains
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-10-29 23:51:41 +0100
committerorwell96 <orwell@bleipb.de>2018-10-29 23:51:41 +0100
commitfbed4e29d163bfaeaec76b2f6c896773b98b254b (patch)
treebf9fc2241ee8696295d7555959c93d17f17766c0 /advtrains
parent0a982b6356b2f4b6a28e74f9f90c4f584169a96d (diff)
downloadadvtrains-fbed4e29d163bfaeaec76b2f6c896773b98b254b.tar.gz
advtrains-fbed4e29d163bfaeaec76b2f6c896773b98b254b.tar.bz2
advtrains-fbed4e29d163bfaeaec76b2f6c896773b98b254b.zip
Document fix 0a982b6356b2f4b6a28e74f9f90c4f584169a96d
Add comment that explains why fix was necessary
Diffstat (limited to 'advtrains')
-rw-r--r--advtrains/trainlogic.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua
index 5bbc565..47d9542 100644
--- a/advtrains/trainlogic.lua
+++ b/advtrains/trainlogic.lua
@@ -246,6 +246,16 @@ function advtrains.train_ensure_init(id, train)
if not train.last_connid then
atwarn("Train",id,": Restoring path: no last_connid set! Will assume 1")
train.last_connid = 1
+ --[[
+ Why this fix was necessary:
+ Issue: Migration problems on Grand Theft Auto Minetest
+ 1. Run of this code, warning printed.
+ 2. path_create failed with result==nil (there was an unloaded node, wait_for_path set)
+ 3. in consequence, the supposed call to path_setrestore does not happen
+ 4. train.last_connid is still unset
+ 5. next step, warning is printed again
+ Result: log flood.
+ ]]
end
local result = advtrains.path_create(train, train.last_pos, train.last_connid or 1, train.last_frac or 0)