From fbed4e29d163bfaeaec76b2f6c896773b98b254b Mon Sep 17 00:00:00 2001 From: orwell96 Date: Mon, 29 Oct 2018 23:51:41 +0100 Subject: Document fix 0a982b6356b2f4b6a28e74f9f90c4f584169a96d Add comment that explains why fix was necessary --- advtrains/trainlogic.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) -- cgit v1.2.3