aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororwell96 <mono96.mml@gmail.com>2017-02-05 13:21:06 +0100
committerorwell96 <mono96.mml@gmail.com>2017-02-05 13:21:06 +0100
commitc79be69aef7575ecc2687be6381485913615d9b5 (patch)
treeec303282013907d74ade4e03227cc60e84c534cf
parentaf14d57557094525be85dea1ad3102a1b41408c7 (diff)
downloadadvtrains-c79be69aef7575ecc2687be6381485913615d9b5.tar.gz
advtrains-c79be69aef7575ecc2687be6381485913615d9b5.tar.bz2
advtrains-c79be69aef7575ecc2687be6381485913615d9b5.zip
Fix itrainmap
-rw-r--r--advtrains/advtrains_itrainmap/init.lua13
1 files changed, 8 insertions, 5 deletions
diff --git a/advtrains/advtrains_itrainmap/init.lua b/advtrains/advtrains_itrainmap/init.lua
index 02dbc9e..96e30c5 100644
--- a/advtrains/advtrains_itrainmap/init.lua
+++ b/advtrains/advtrains_itrainmap/init.lua
@@ -72,12 +72,15 @@ end
local function cache_ndb()
itm_cache={}
local ndb_nodes=advtrains.ndb.get_nodes()
- for phs,_ in pairs(ndb_nodes) do
- local pos=minetest.get_position_from_hash(phs)
- if not itm_cache[pos.x] then
- itm_cache[pos.x]={}
+ for y, xzt in pairs(ndb_nodes) do
+ for x, zt in pairs(xzt) do
+ for z, _ in pairs(zt) do
+ if not itm_cache[x] then
+ itm_cache[x]={}
+ end
+ itm_cache[x][z]=y
+ end
end
- itm_cache[pos.x][pos.z]=pos.y
end
end