aboutsummaryrefslogtreecommitdiff
path: root/src/physics.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/physics.c')
-rw-r--r--src/physics.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/physics.c b/src/physics.c
index 7b6b2b7..08295a9 100644
--- a/src/physics.c
+++ b/src/physics.c
@@ -238,8 +238,10 @@ static int physics_collision_room(ModelInstance *obj, Game *game, double dt, Col
if ( room != NULL ) {
int j;
for ( j=0; j<room->num_objects; j++ ) {
- if ( physics_check_collide(obj, room->objects[j], dt, coll, room, game) ) {
- found = 1;
+ if ( room->objects[j] != NULL ) {
+ if ( physics_check_collide(obj, room->objects[j], dt, coll, room, game) ) {
+ found = 1;
+ }
}
}
}