Skip to content

Commit

Permalink
Save from aabb arguement error
Browse files Browse the repository at this point in the history
Happens sometimes when the math doesn't jive
Instead of fatally dying, just simply return nil

Possibly resolves #165
  • Loading branch information
grepsedawk committed Jul 22, 2023
1 parent 3b4efd8 commit 77feac1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/rosegold/world/aabb.cr
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ module Rosegold::AABB(T, V)
return nil if t_far < 0

t_near
rescue e : ArgumentError
nil
end

def [](i) : V
Expand Down

0 comments on commit 77feac1

Please sign in to comment.