HybridDog / onomatopoeia

Isometric mapper for Minetest
GNU General Public License v3.0
6 stars 2 forks source link

TypeError in ord() #4

Open chrbinder opened 1 year ago

chrbinder commented 1 year ago

When I'm using onomatopoeia with map.sqlite, I get the following error:

Traceback (most recent call last):
  File "/home/chbinder/.minetest/tools/onomatopoeia/mapper.py", line 272, in <module>
    main()
  File "/home/chbinder/.minetest/tools/onomatopoeia/mapper.py", line 208, in main
    mapper.stupidMakeTiles(*coord)
  File "/home/chbinder/.minetest/tools/onomatopoeia/mapper.py", line 151, in stupidMakeTiles
    y = self.chunks3(canvas, x + step, z + step, step)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chbinder/.minetest/tools/onomatopoeia/mapper.py", line 102, in chunks3
    chunk, y = self.makeChunk(x, z)
               ^^^^^^^^^^^^^^^^^^^^
  File "/home/chbinder/.minetest/tools/onomatopoeia/mapper.py", line 77, in makeChunk
    self.drawBlock(
  File "/home/chbinder/.minetest/tools/onomatopoeia/mapper.py", line 47, in drawBlock
    map_block = self.map.getBlock(bx, by, bz)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chbinder/.minetest/tools/onomatopoeia/map.py", line 87, in getBlock
    static_object_version = readU8(f)
                            ^^^^^^^^^
  File "/home/chbinder/.minetest/tools/onomatopoeia/util.py", line 22, in readU8
    return ord(f.read(1))
           ^^^^^^^^^^^^^^
TypeError: ord() expected a character, but string of length 0 found

I've tested on a 300mb and a 10mb map.

HybridDog commented 1 year ago

In case you used this version of onomatopoeia with a recent Minetest map: I think it no longer works since the Minetest map database format has changed, e.g. it uses Zstandard for compression now. listia's fork has a commit to support newer Minetest maps: https://github.com/listia/onomatopoeia/commit/96863feaacc1546c0958f687bfe8ed59d9e617ba