projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- fixed level editor crash (a hack)
[supertux.git]
/
src
/
collision.cpp
diff --git
a/src/collision.cpp
b/src/collision.cpp
index
fc7a902
..
58c48c6
100644
(file)
--- a/
src/collision.cpp
+++ b/
src/collision.cpp
@@
-44,6
+44,9
@@
bool rectcollision_offset(const base_type& one, const base_type& two, float off_
bool collision_object_map(const base_type& base)
{
bool collision_object_map(const base_type& base)
{
+ if(!World::current())
+ return false;
+
const Level& level = *World::current()->get_level();
TileManager& tilemanager = *TileManager::instance();
const Level& level = *World::current()->get_level();
TileManager& tilemanager = *TileManager::instance();
@@
-56,7
+59,7
@@
bool collision_object_map(const base_type& base)
for(int x = starttilex; x*32 < max_x; ++x) {
for(int y = starttiley; y*32 < max_y; ++y) {
Tile* tile = tilemanager.get(level.get_tile_at(x, y));
for(int x = starttilex; x*32 < max_x; ++x) {
for(int y = starttiley; y*32 < max_y; ++y) {
Tile* tile = tilemanager.get(level.get_tile_at(x, y));
- if(tile->solid)
+ if(tile
&& tile
->solid)
return true;
}
}
return true;
}
}
@@
-248,6
+251,13
@@
bool issolid(float x, float y)
return tile && tile->solid;
}
return tile && tile->solid;
}
+bool isunisolid(float x, float y)
+{
+ Tile* tile = gettile(x,y);
+ return tile && tile->unisolid;
+}
+
+
bool isbrick(float x, float y)
{
Tile* tile = gettile(x,y);
bool isbrick(float x, float y)
{
Tile* tile = gettile(x,y);
@@
-260,6
+270,12
@@
bool isice(float x, float y)
return tile && tile->ice;
}
return tile && tile->ice;
}
+bool isspike(float x, float y)
+{
+ Tile* tile = gettile(x,y);
+ return tile && tile->spike;
+}
+
bool isfullbox(float x, float y)
{
Tile* tile = gettile(x,y);
bool isfullbox(float x, float y)
{
Tile* tile = gettile(x,y);