craftyjs/Crafty — pull request #813 by heniotierra (2014-08-11 01:15:37+00:00)
Title: Fixed problem when trying to load already loaded asset

Hi!

This patch fixes problem with refactored loader function that occurs when trying to (re)download already loaded assets.

Couple months ago I sent a PR with a fix for this, which made sure the file wouldn't be redownloaded, and still would call the onComplete function - but it wouldn't call the onError function in this specific situation.

This patch now does all that: avoids redownloading the given asset, calls the onError function, and properly calls onComplete when finished.

I messed that first PR when trying to push (squashing) this updated version, so please forgive me for sending it again.