projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6c6db31
)
let the TileManager always return a valid tile in case of error
author
Ingo Ruhnke
<grumbel@gmx.de>
Tue, 23 Nov 2004 16:49:13 +0000
(16:49 +0000)
committer
Ingo Ruhnke
<grumbel@gmx.de>
Tue, 23 Nov 2004 16:49:13 +0000
(16:49 +0000)
SVN-Revision: 2155
src/tile_manager.h
patch
|
blob
|
history
diff --git
a/src/tile_manager.h
b/src/tile_manager.h
index
3e9052f
..
6c2e8cc
100644
(file)
--- a/
src/tile_manager.h
+++ b/
src/tile_manager.h
@@
-70,7
+70,16
@@
class TileManager
const Tile* get(uint32_t id) const
{
assert(id < tiles.size());
- return tiles[id];
+ Tile* t = tiles[id];
+ if (t)
+ {
+ return t;
+ }
+ else
+ {
+ std::cout << "TileManager: Invalid tile: " << id << std::endl;
+ return tiles[0];
+ }
}
uint32_t get_max_tileid() const