diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-15 14:03:04 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-15 14:03:04 +0000 |
commit | 806dd2ec3cdb39c8ae528b65f93984ed66496709 (patch) | |
tree | 6f654774ee4e0e6275f5904093dea0147ead9edf /src/graphic | |
parent | aa42c03c8a6b10d4fac03143f06811d94a253270 (diff) | |
download | mana-806dd2ec3cdb39c8ae528b65f93984ed66496709.tar.gz mana-806dd2ec3cdb39c8ae528b65f93984ed66496709.tar.bz2 mana-806dd2ec3cdb39c8ae528b65f93984ed66496709.tar.xz mana-806dd2ec3cdb39c8ae528b65f93984ed66496709.zip |
Fixing crash on death. Death handling could still be improved though.
Diffstat (limited to 'src/graphic')
-rw-r--r-- | src/graphic/graphic.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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); } |