adds validation for missing image sources on tilesheets
This commit is contained in:
parent
251d83472c
commit
7c6da8e5ec
|
@ -432,6 +432,12 @@ namespace StardewModdingAPI.Framework.ContentManagers
|
||||||
this.Monitor.VerboseLog($"Fixing tilesheet paths for map '{relativeMapPath}' from mod '{this.ModName}'...");
|
this.Monitor.VerboseLog($"Fixing tilesheet paths for map '{relativeMapPath}' from mod '{this.ModName}'...");
|
||||||
foreach (TileSheet tilesheet in map.TileSheets)
|
foreach (TileSheet tilesheet in map.TileSheets)
|
||||||
{
|
{
|
||||||
|
// validate image source
|
||||||
|
if (string.IsNullOrWhiteSpace(tilesheet.ImageSource))
|
||||||
|
{
|
||||||
|
throw new SContentLoadException(ContentLoadErrorType.InvalidData, $"Could not load tilesheet '{tilesheet.Id}' for mod {this.ModName} - no image source found.");
|
||||||
|
}
|
||||||
|
|
||||||
// get image source
|
// get image source
|
||||||
tilesheet.ImageSource = this.NormalizePathSeparators(tilesheet.ImageSource);
|
tilesheet.ImageSource = this.NormalizePathSeparators(tilesheet.ImageSource);
|
||||||
string imageSource = tilesheet.ImageSource;
|
string imageSource = tilesheet.ImageSource;
|
||||||
|
|
Loading…
Reference in New Issue