From 806dd2ec3cdb39c8ae528b65f93984ed66496709 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sat, 15 Jan 2005 14:03:04 +0000 Subject: Fixing crash on death. Death handling could still be improved though. --- src/graphic/graphic.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/graphic') diff --git a/src/graphic/graphic.cpp b/src/graphic/graphic.cpp index 1759f72a..1e40c845 100644 --- a/src/graphic/graphic.cpp +++ b/src/graphic/graphic.cpp @@ -256,11 +256,11 @@ void GraphicEngine::refresh() { unsigned short tile0 = get_tile(i + camera_x, j + camera_y, 0); unsigned short tile1 = get_tile(i + camera_x, j + camera_y, 1); - if (tile0 < 600) { + if (tile0 < tileset->spriteset.size()) { tileset->spriteset[tile0]->draw(buffer, i * 32 - offset_x, j * 32 - offset_y); } - if (tile1 > 0) { //&& tile1 < 600 + if (tile1 > 0 && tile1 < tileset->spriteset.size()) { tileset->spriteset[tile1]->draw(buffer, i * 32 - offset_x, j * 32 - offset_y); } @@ -418,7 +418,7 @@ void GraphicEngine::refresh() { for (int i = 0; i < 26; i++) { unsigned short tile = get_tile(i + camera_x, j + camera_y, 2); - if (tile > 0 && tile < 600) { + if (tile > 0 && tile < tileset->spriteset.size()) { tileset->spriteset[tile]->draw( buffer, i * 32 - offset_x, j * 32 - offset_y); } -- cgit v1.2.3-70-g09d2