0

fixed biomes to use z/x instead of x/z indexing

reference: Issue #644
This commit is contained in:
Aaron Griffith
2012-03-15 05:10:03 -04:00
parent 9be414e540
commit 9ba3cbabc8
2 changed files with 7 additions and 7 deletions

View File

@@ -214,7 +214,7 @@ base_draw(void *data, RenderState *state, PyObject *src, PyObject *mask, PyObjec
if (self->use_biomes) {
/* average over all neighbors */
for (dx = -1; dx <= 1; dx++) {
for (dz = -1; dz <= 1; dz += (dx == 0 ? 2 : 1)) {
for (dz = -1; dz <= 1; dz++) {
unsigned char biome = get_data(state, BIOMES, state->x + dx, state->y, state->z + dz);
if (biome >= NUM_BIOMES) {
/* note -- biome 255 shows up on map borders.
@@ -227,8 +227,8 @@ base_draw(void *data, RenderState *state, PyObject *src, PyObject *mask, PyObjec
rain += biome_table[biome].rainfall;
}
}
temp /= 8.0;
rain /= 8.0;
temp /= 9.0;
rain /= 9.0;
} else {
/* don't use biomes, just use the default */
temp = biome_table[DEFAULT_BIOME].temperature;