diff --git a/1.4/Assemblies/PerformanceFish.dll b/1.4/Assemblies/PerformanceFish.dll index 57ae77a..5d28c31 100644 Binary files a/1.4/Assemblies/PerformanceFish.dll and b/1.4/Assemblies/PerformanceFish.dll differ diff --git a/1.4/Assemblies/PerformanceFish.pdb b/1.4/Assemblies/PerformanceFish.pdb index a87a9ab..0bab96e 100644 Binary files a/1.4/Assemblies/PerformanceFish.pdb and b/1.4/Assemblies/PerformanceFish.pdb differ diff --git a/1.5/Assemblies/PerformanceFish.dll b/1.5/Assemblies/PerformanceFish.dll index ff62dd2..e537328 100644 Binary files a/1.5/Assemblies/PerformanceFish.dll and b/1.5/Assemblies/PerformanceFish.dll differ diff --git a/1.5/Assemblies/PerformanceFish.pdb b/1.5/Assemblies/PerformanceFish.pdb index bf2437e..68a6ca9 100644 Binary files a/1.5/Assemblies/PerformanceFish.pdb and b/1.5/Assemblies/PerformanceFish.pdb differ diff --git a/Source/PerformanceFish/Directory.Build.Props b/Source/PerformanceFish/Directory.Build.Props index c681817..133edb3 100644 --- a/Source/PerformanceFish/Directory.Build.Props +++ b/Source/PerformanceFish/Directory.Build.Props @@ -4,7 +4,7 @@ PerformanceFish PerformanceFish bradson - 0.6.1.0 + 0.6.1.1 LICENSE net48 preview diff --git a/Source/PerformanceFish/ModCompatibility/ActiveMods.cs b/Source/PerformanceFish/ModCompatibility/ActiveMods.cs index 33f138e..ebd0668 100644 --- a/Source/PerformanceFish/ModCompatibility/ActiveMods.cs +++ b/Source/PerformanceFish/ModCompatibility/ActiveMods.cs @@ -101,12 +101,7 @@ public static class ActiveMods } private static void CheckFisheryVersion() - { - if (FisheryLib.FisheryLib.VERSION > FisheryLib.FisheryLib.CurrentlyLoadedVersion) - ErrorForOutdatedModDependency(nameof(Fishery)); - else - CheckDependencyVersion(nameof(Fishery), typeof(FisheryLib.FisheryLib), "1Fishery"); - } + => CheckDependencyVersion(nameof(Fishery), typeof(FisheryLib.FisheryLib), "1Fishery"); private static void CheckHarmonyVersion() => CheckDependencyVersion(nameof(Harmony), typeof(Harmony), "0Harmony"); @@ -164,11 +159,7 @@ public static class ActiveMods return firstFoundAssemblyDir ?? "Unknown"; } - - private static void ErrorForOutdatedModDependency(string modName) - => Log.Error($"Outdated {modName} mod detected. { - modName} must be updated for Performance Fish to work correctly"); - + private static void ThrowForMissingModDependency(string modName) { Log.Error($"{modName} mod is missing. Performance Fish requires this mod in order to function."); diff --git a/Source/PerformanceFish/Rendering/PrintImprovements.cs b/Source/PerformanceFish/Rendering/PrintImprovements.cs index de3176c..d77cfc5 100644 --- a/Source/PerformanceFish/Rendering/PrintImprovements.cs +++ b/Source/PerformanceFish/Rendering/PrintImprovements.cs @@ -99,11 +99,11 @@ public sealed class PrintImprovements : ClassWithFishPrepatches if (printPlaneIndex < 0) { - throw new InvalidOperationException( + ThrowHelper.ThrowInvalidOperationException( "Failed to find center variable load instruction for PrintPlane call"); } - - ilProcessor.InsertAt(printPlaneIndex + 1, (OpCodes.Call, methodof(AdjustCenter))); + + ilProcessor.InsertRange(printPlaneIndex + 1, OpCodes.Ldarg_0, (OpCodes.Call, methodof(AdjustCenter))); } finally { @@ -111,11 +111,21 @@ public sealed class PrintImprovements : ClassWithFishPrepatches } } - public static Vector3 AdjustCenter(Vector3 center) + public static Vector3 AdjustCenter(Vector3 center, Plant plant) { - if (Math.Abs(center.y - LowPlantAltitude) <= 0.001f) - center.y += 0.005f; - + if (Math.Abs(center.y - LowPlantAltitude) > 0.001f) + return center; + + var plantPosition = plant.PositionHeld; + var map = plant.MapHeld; + if (map.edificeGrid[plantPosition.CellToIndex(map)] is + { + def.altitudeLayer: AltitudeLayer.LowPlant + } building) + { + center.y += ((plantPosition.z - building.OccupiedRect().minZ) * 0.01f) + 0.005f; + } + return center; }