summaryrefslogtreecommitdiff
path: root/src/graphic/graphic.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-15 14:03:04 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-15 14:03:04 +0000
commit806dd2ec3cdb39c8ae528b65f93984ed66496709 (patch)
tree6f654774ee4e0e6275f5904093dea0147ead9edf /src/graphic/graphic.cpp
parentaa42c03c8a6b10d4fac03143f06811d94a253270 (diff)
downloadmana-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/graphic.cpp')
-rw-r--r--src/graphic/graphic.cpp6
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);
}