summaryrefslogtreecommitdiff
path: root/platforms.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platforms.cpp')
-rw-r--r--platforms.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/platforms.cpp b/platforms.cpp
index 4cfa707..7bf9968 100644
--- a/platforms.cpp
+++ b/platforms.cpp
@@ -57,6 +57,11 @@ static Rect platform_bounding_box(Platform const *platform) {
float y1 = platform_lowest_coordinate(platform, true);
float x2 = platform_highest_coordinate(platform, false);
float y2 = platform_highest_coordinate(platform, true);
+ bool any_nan = (isnan(x1) || isnan(y1) || isnan(x2) || isnan(y2)); // this used to be a problem, but it should be fixed now. this is here just in case.
+ assert(!any_nan);
+ if (any_nan) {
+ return rect4(-1000, -1000, 1000, 1000);
+ }
return rect4(x1, y1, x2, y2);
}