get_data will no longer repeatedly try to open missing chunks
This commit is contained in:
@@ -129,6 +129,17 @@ int load_chunk(RenderState* state, int x, int z, unsigned char required) {
|
|||||||
if (dest->loaded)
|
if (dest->loaded)
|
||||||
return 0;
|
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;
|
x += state->chunkx;
|
||||||
z += state->chunkz;
|
z += state->chunkz;
|
||||||
|
|
||||||
@@ -155,16 +166,6 @@ int load_chunk(RenderState* state, int x, int z, unsigned char required) {
|
|||||||
return 1;
|
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");
|
dest->biomes = PyDict_GetItemString(chunk, "Biomes");
|
||||||
Py_INCREF(dest->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(sections);
|
||||||
Py_DECREF(chunk);
|
Py_DECREF(chunk);
|
||||||
|
|
||||||
dest->loaded = 1;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
// increment this value if you've made a change to the c extesion
|
// increment this value if you've made a change to the c extesion
|
||||||
// and want to force users to rebuild
|
// and want to force users to rebuild
|
||||||
#define OVERVIEWER_EXTENSION_VERSION 28
|
#define OVERVIEWER_EXTENSION_VERSION 29
|
||||||
|
|
||||||
/* Python PIL, and numpy headers */
|
/* Python PIL, and numpy headers */
|
||||||
#include <Python.h>
|
#include <Python.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user