amethyst / evoli

An ecosystem-simulation game made with Amethyst
https://community.amethyst.rs/t/evoli-introduction/770
Other
217 stars 33 forks source link

Fix loading Wind resource from config file #116

Closed Jazarro closed 4 years ago

Jazarro commented 4 years ago

This fixes a bug that caused the Wind config file to always be ignored. As a result, the wind was always zero at the start of the game and topplegrass entities never move after they spawn.

After the resource is loaded, it is not unwrapped before it is inserted into the world. Amethyst later automatically adds the resource by calling default().

To fix this, the result is unwrapped. Additionally, if the loading failed, this is logged as an error but a fallback is used to prevent the game from crashing.