Skip to content

Commit

Permalink
Small checks
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaPiggy committed Sep 1, 2024
1 parent e329943 commit 7cb5b23
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Winch/Util/AssetBundleUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static Shader GetReplacementShader(string name)
Shader replacementShader;
if (cachedShaders.TryGetValue(name, out replacementShader)) return replacementShader;

replacementShader = Resources.FindObjectsOfTypeAll<Shader>().Reverse().FirstOrDefault(shader => shader.name == name);// Shader.Find(name);
replacementShader = Resources.FindObjectsOfTypeAll<Shader>().Where(shader => shader.isSupported).Reverse().FirstOrDefault(shader => shader.name == name);// Shader.Find(name);
if (replacementShader != null)
return replacementShader.CacheShader();

Expand Down
2 changes: 1 addition & 1 deletion Winch/Util/PoiUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static CustomPOI GetModdedPOI(string id)

internal static void PopulateHarvestablesAndHarvestParticlePrefabs()
{
foreach (var harvestableParticle in Resources.FindObjectsOfTypeAll<HarvestableParticles>().Reverse())
foreach (var harvestableParticle in Resources.FindObjectsOfTypeAll<HarvestableParticles>().Where(hp => !ModdedHarvestParticlePrefabs.Values.Contains(hp.gameObject)).Reverse())
{
var prefab = harvestableParticle.gameObject;
var name = prefab.name.RemoveClone();
Expand Down

0 comments on commit 7cb5b23

Please sign in to comment.