Posts: 6,482
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1085 thank(s) in 857 post(s)
Well that one is a bit more involved, since it is using a multi-callback - one callback for coords, one for heightmap, another for biome map, blocktypes, blockmeta, ... Have a look at cChunkDataCallback in ChunkDef.h. Now I don't know how to make that Lua-accessible easily - should the function take a gazillion arguments, one for each callback function? Or a Lua object with functions assigned to it for each callback? Also, my Lua hacking skills are not up to this megatask.
Posts: 313
Threads: 32
Joined: Feb 2012
Thanks: 98
Given 14 thank(s) in 13 post(s)
Ok, seems like bug is fixed.
What it was:
Somehow using file = io.open(PLUGIN:GetLocalDirectory().."/portals_portals.dat", "w+") with "w+" mode caused data to be corrupted upon re-writing. Using just "w" mode works just fine (or, at least, seems to be fine at first test).
I'll do some more my lua magic and then will upload updated version, I guess. In case anyone suffers the bug and needs it immediately I can provide quick-fixed version.
Posts: 313
Threads: 32
Joined: Feb 2012
Thanks: 98
Given 14 thank(s) in 13 post(s)
Alright, it's not fixed still. For no obvious reason table with portals data corrupts. I have no idea why right now.