diff --git a/overviewer_core/src/iterate.c b/overviewer_core/src/iterate.c index b8791cc..bbc9446 100644 --- a/overviewer_core/src/iterate.c +++ b/overviewer_core/src/iterate.c @@ -129,6 +129,17 @@ int load_chunk(RenderState* state, int x, int z, unsigned char required) { if (dest->loaded) return 0; + /* set up reasonable defaults */ + dest->biomes = NULL; + for (i = 0; i < SECTIONS_PER_CHUNK; i++) + { + dest->sections[i].blocks = NULL; + dest->sections[i].data = NULL; + dest->sections[i].skylight = NULL; + dest->sections[i].blocklight = NULL; + } + dest->loaded = 1; + x += state->chunkx; z += state->chunkz; @@ -155,16 +166,6 @@ int load_chunk(RenderState* state, int x, int z, unsigned char required) { return 1; } - /* set up reasonable defaults */ - dest->biomes = NULL; - for (i = 0; i < SECTIONS_PER_CHUNK; i++) - { - dest->sections[i].blocks = NULL; - dest->sections[i].data = NULL; - dest->sections[i].skylight = NULL; - dest->sections[i].blocklight = NULL; - } - dest->biomes = PyDict_GetItemString(chunk, "Biomes"); Py_INCREF(dest->biomes); @@ -183,7 +184,6 @@ int load_chunk(RenderState* state, int x, int z, unsigned char required) { Py_DECREF(sections); Py_DECREF(chunk); - dest->loaded = 1; return 0; } diff --git a/overviewer_core/src/overviewer.h b/overviewer_core/src/overviewer.h index b7d35c3..132d187 100644 --- a/overviewer_core/src/overviewer.h +++ b/overviewer_core/src/overviewer.h @@ -26,7 +26,7 @@ // increment this value if you've made a change to the c extesion // and want to force users to rebuild -#define OVERVIEWER_EXTENSION_VERSION 28 +#define OVERVIEWER_EXTENSION_VERSION 29 /* Python PIL, and numpy headers */ #include