aroberge / reeborg

Enhanced Karel-the-robot clone
http://reeborg.ca/reeborg.html
Other
47 stars 36 forks source link

Avoid reloading images twice #348

Closed aroberge closed 7 years ago

aroberge commented 7 years ago

Currently RUR.add_new_thing logs a warning to the console if a new "thing" is added with an existing name, but otherwise proceed to add this new "thing" which may involve reloading images, etc.

Instead, the options with which the thing was added initially should be saved, and compared with the new request: if they are identical, then, it is the same "thing" we want and we should simply return without recreating a new "thing".