-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize rotation code: use got's improvements to SetPosRot and use a…
… cache for modules so we don't have to look up each time.
- Loading branch information
1 parent
be93708
commit bda429b
Showing
5 changed files
with
70 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using HarmonyLib; | ||
using UnityEngine; | ||
|
||
namespace RealismOverhaul.Harmony | ||
{ | ||
[HarmonyPatch(typeof(FlightGlobals))] | ||
internal class PatchFlightGlobals | ||
{ | ||
[HarmonyPostfix] | ||
[HarmonyPatch(nameof(FlightGlobals.OnSceneChange))] | ||
internal static void Postfix_OnSceneChange() | ||
{ | ||
VesselModuleRotationRO.ClearCache(); | ||
} | ||
|
||
[HarmonyPostfix] | ||
[HarmonyPatch(nameof(FlightGlobals.RemoveVessel))] | ||
internal static void Postfix_RemoveVessel(Vessel vessel) | ||
{ | ||
VesselModuleRotationRO.RemoveVessel(vessel); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters