summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-03-05 18:12:00 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-03-05 18:12:00 -0500
commitdebe17724129c947dddf029c725af5224940cd0e (patch)
tree81d7b361eb6832c18218101165c1f094d3cf02b4 /src/SMAPI/Framework
parentb68b301b712a0047a7d6f24aa2fb776e19f8086d (diff)
downloadSMAPI-debe17724129c947dddf029c725af5224940cd0e.tar.gz
SMAPI-debe17724129c947dddf029c725af5224940cd0e.tar.bz2
SMAPI-debe17724129c947dddf029c725af5224940cd0e.zip
handle vanilla assets in DoesAssetExist (#766)
Diffstat (limited to 'src/SMAPI/Framework')
-rw-r--r--src/SMAPI/Framework/ContentManagers/GameContentManager.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/SMAPI/Framework/ContentManagers/GameContentManager.cs b/src/SMAPI/Framework/ContentManagers/GameContentManager.cs
index e7fb0c5f..9b8125ad 100644
--- a/src/SMAPI/Framework/ContentManagers/GameContentManager.cs
+++ b/src/SMAPI/Framework/ContentManagers/GameContentManager.cs
@@ -68,11 +68,15 @@ namespace StardewModdingAPI.Framework.ContentManagers
if (base.DoesAssetExist(assetName))
return true;
+ // vanilla asset
+ if (File.Exists(Path.Combine(this.RootDirectory, $"{assetName.Name}.xnb")))
+ return true;
+
// managed asset
if (this.Coordinator.TryParseManagedAssetKey(assetName.Name, out string contentManagerID, out IAssetName relativePath))
return this.Coordinator.DoesManagedAssetExist(contentManagerID, relativePath);
- // else check for loaders
+ // custom asset from a loader
string locale = this.GetLocale();
IAssetInfo info = new AssetInfo(locale, assetName, typeof(object), this.AssertAndNormalizeAssetName);
ModLinked<IAssetLoader>[] loaders = this.GetLoaders<object>(info).ToArray();