SMAPI - Stardew Modding API

SMAPI - Stardew Modding API

971k Downloads

Fix "mandatory" load warnings

cyStuff opened this issue ยท 2 comments

commented

In the case where an IAssetLoader loads a default asset in Load<T>(IAssetInfo asset) with return Helper.Content.Load<T>(asset.AssetName, ContentSource.GameContent);, the warning "Broke loop while loading asset <AssetName>." may sometimes appear.

commented

This could possibly be fixed by adding a optional bool argument to the Helper.Content.Load<T> function to ignore warnings, or to have a better way in general to load a default asset intentionally without causing warnings or errors.

commented

I resolved the issue by messing with the CanLoad<T> function. I did not realize it was called immediately before the load function every time, I assumed it was only called once when the IAssetLoader was initialized.