0

get_data will no longer repeatedly try to open missing chunks

This commit is contained in:
Aaron Griffith
2012-03-03 22:03:20 -05:00
parent 628b24d073
commit 4a9c4fd150
2 changed files with 12 additions and 12 deletions

View File

@@ -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;
}

View File

@@ -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 <Python.h>