mirror of
https://github.com/1bardesign/batteries.git
synced 2024-11-22 06:04:35 +00:00
fixed intersect.balance_from_mass crashing with nil/false mass
This commit is contained in:
parent
ef4ef69b0f
commit
19bb169e55
@ -521,8 +521,8 @@ end
|
||||
-- returns false if we're colliding two static bodies, as that's invalid
|
||||
function intersect.balance_from_mass(a_mass, b_mass)
|
||||
--static cases
|
||||
local a_static = a_mass <= 0 or a_mass == math.huge or not a_mass
|
||||
local b_static = b_mass <= 0 or b_mass == math.huge or not a_mass
|
||||
local a_static = not a_mass or a_mass <= 0 or a_mass == math.huge
|
||||
local b_static = not b_mass or b_mass <= 0 or b_mass == math.huge
|
||||
if a_static and b_static then
|
||||
return false --colliding two static bodies
|
||||
elseif a_static then
|
||||
|
Loading…
Reference in New Issue
Block a user