aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/gob/scenery.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/engines/gob/scenery.cpp b/engines/gob/scenery.cpp
index fa7944c203..2da6b092e0 100644
--- a/engines/gob/scenery.cpp
+++ b/engines/gob/scenery.cpp
@@ -286,6 +286,9 @@ void Scenery::renderStatic(int16 scenery, int16 layer) {
pieceIndex = planePtr->pieceIndex;
pictIndex = planePtr->pictIndex - 1;
+ if ((pictIndex >= _staticPictCount[scenery]) || (!ptr->pieces))
+ continue;
+
_vm->_draw->_destSpriteX = planePtr->destX;
_vm->_draw->_destSpriteY = planePtr->destY;
left = FROM_LE_16(ptr->pieces[pictIndex][pieceIndex].left);