0

Fixes segfaults in the C extension

This should have been part of 70ef0af0 but I didn't catch these.
This commit is contained in:
Andrew Brown
2012-01-16 22:00:44 -05:00
parent 66295aabd9
commit bbe105ead7
4 changed files with 11 additions and 11 deletions

View File

@@ -133,8 +133,8 @@ estimate_blocklevel(RenderPrimitiveLighting *self, RenderState *state,
}
/* also, make sure we have enough info to correctly calculate lighting */
if (blocks == Py_None || blocks == NULL ||
blocklight == Py_None || blocklight == NULL) {
if (blocks == NULL ||
blocklight == NULL) {
return 0;
}
@@ -294,7 +294,7 @@ lighting_is_face_occluded(RenderState *state, int skip_sides, int x, int y, int
/* this face isn't visible, so don't draw anything */
return 1;
}
} else if (skip_sides && (x == -1) && (state->left_blocks != Py_None)) {
} else if (skip_sides && (x == -1) && (state->left_blocks != NULL)) {
unsigned char block = getArrayByte3D(state->left_blocks, 15, state->y, state->z);
if (!is_transparent(block)) {
/* the same thing but for adjacent chunks, this solves an
@@ -303,7 +303,7 @@ lighting_is_face_occluded(RenderState *state, int skip_sides, int x, int y, int
tessellate-able */
return 1;
}
} else if (skip_sides && (y == 16) && (state->right_blocks != Py_None)) {
} else if (skip_sides && (y == 16) && (state->right_blocks != NULL)) {
unsigned char block = getArrayByte3D(state->right_blocks, state->x, 0, state->z);
if (!is_transparent(block)) {
/* the same thing but for adjacent chunks, this solves an