MrGVSV / bevy_proto

Create config files for entities in Bevy
Other
239 stars 25 forks source link

Correctly handle `ProtoAsset::HandleId` #38

Closed MrGVSV closed 1 year ago

MrGVSV commented 1 year ago

33 added ProtoAsset::HandleId. The main purpose of this was to allow for default ProtoAsset values using Handle<T>::default().

However, the derive macro failed to account for this properly, resulting in a panic when attempting to spawn the prototype.

The behavior of preloading a ProtoAsset::HandleId is correct— we should not be able to preload anything just by its HandleId. This PR just makes the error message a little clearer.