aboutsummaryrefslogtreecommitdiff
path: root/advtrains/atc.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-10-17 21:02:43 +0200
committerorwell96 <orwell@bleipb.de>2018-10-17 21:06:13 +0200
commitb03e402c718e8bc39d8aa57c5fe67c5722708c37 (patch)
treed61f49db100a3003d5280dff4309ac368123e0e2 /advtrains/atc.lua
parenta71041b66b0518625083560a4acb7f38bbc18148 (diff)
downloadadvtrains-b03e402c718e8bc39d8aa57c5fe67c5722708c37.tar.gz
advtrains-b03e402c718e8bc39d8aa57c5fe67c5722708c37.tar.bz2
advtrains-b03e402c718e8bc39d8aa57c5fe67c5722708c37.zip
Fix node database ATC rail bug
After successfully registering newly-placed ATC rails in the nodedb, the rail's after_place_node() callback (local apn_func()) immediately cleared it again by passing a "node" object that was actually a player object and thus had no "name" or "param2" to ndb.update(), which it handled how it should not in this situation. Since those ndb.update calls were unnecessary anyways, I removed them completely.
Diffstat (limited to 'advtrains/atc.lua')
-rw-r--r--advtrains/atc.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/advtrains/atc.lua b/advtrains/atc.lua
index 10321d9..465a0ec 100644
--- a/advtrains/atc.lua
+++ b/advtrains/atc.lua
@@ -71,8 +71,8 @@ end
--nodes
local idxtrans={static=1, mesecon=2, digiline=3}
-local apn_func=function(pos, node)
- advtrains.ndb.update(pos, node)
+local apn_func=function(pos)
+ -- FIX for long-persisting ndb bug: there's no node in parameter 2 of this function!
local meta=minetest.get_meta(pos)
if meta then
meta:set_string("infotext", attrans("ATC controller, unconfigured."))