diff options
| author | 1029chris <1029chris@gmail.com> | 2016-07-19 15:29:00 -0700 |
|---|---|---|
| committer | 1029chris <1029chris@gmail.com> | 2016-07-19 15:29:00 -0700 |
| commit | 2f501b5492c0bfc51a180a6b498faaedc93ca876 (patch) | |
| tree | 68cdf22fb28e810746b0c354e6a5f74379401c34 | |
| parent | 770f7491809624e1201f341dc04eeb02b30a120e (diff) | |
An attempt to fix crashes on systems with low fps.
| -rw-r--r-- | assets.lua | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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 |
