commit 8e382e55126529c867720b3c5f080717bbdf2561
parent d5bdd4f1f1f17df87f8d694e1b5d8f16b25035b2
Author: Michael Savage <mikejsavage@gmail.com>
Date: Wed, 1 Nov 2017 23:48:17 +0200
Collision quadtree is now one unit bigger than the world, so return 0 height outside the world bounds
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/heightmap.cc b/heightmap.cc
@@ -44,8 +44,8 @@ float heightmap_height( const Heightmap * hm, u32 x, u32 y ) {
}
u16 heightmap_height_u16( const Heightmap * hm, u32 x, u32 y ) {
- ASSERT( x < hm->width );
- ASSERT( y < hm->height );
+ if( x >= hm->width || y >= hm->height )
+ return 0;
return hm->pixels[ y * hm->width + x ];
}