aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author1029chris <1029chris@gmail.com>2016-07-19 15:29:00 -0700
committer1029chris <1029chris@gmail.com>2016-07-19 15:29:00 -0700
commit2f501b5492c0bfc51a180a6b498faaedc93ca876 (patch)
tree68cdf22fb28e810746b0c354e6a5f74379401c34
parent770f7491809624e1201f341dc04eeb02b30a120e (diff)
An attempt to fix crashes on systems with low fps.
-rw-r--r--assets.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/assets.lua b/assets.lua
index 9d72163..5114dd1 100644
--- a/assets.lua
+++ b/assets.lua
@@ -273,7 +273,9 @@ function loadAnimation(pic, quad, frames, limit, w, h)
end
end
function playAnimation(ani, loop, x, y, r, s, xo, yo, sp)
- love.graphics.draw(ani.pic, ani.fs[math.floor(ani.f)], x, y, r, s, s, xo, yo)
+ if ani.fs[math.floor(ani.f)] ~= nil then
+ love.graphics.draw(ani.pic, ani.fs[math.floor(ani.f)], x, y, r, s, s, xo, yo)
+ end
if loop == true and #ani.fs <= ani.f then
ani.f = 1
elseif loop == false and ani.f >= #ani.fs then