From 6be680ac8ea98b66400d1de71e97d5122cd4ac5c Mon Sep 17 00:00:00 2001 From: "Nick J. Connors" Date: Thu, 30 Dec 2021 16:47:08 -0500 Subject: [PATCH] Fixed static objects still moving --- .../Builder/General/HeavenlyBodyBuilder.cs | 18 ++++++++---- NewHorizons/NewHorizons.csproj | 29 +++---------------- 2 files changed, 16 insertions(+), 31 deletions(-) diff --git a/NewHorizons/Builder/General/HeavenlyBodyBuilder.cs b/NewHorizons/Builder/General/HeavenlyBodyBuilder.cs index 5b634669..d41cb52e 100644 --- a/NewHorizons/Builder/General/HeavenlyBodyBuilder.cs +++ b/NewHorizons/Builder/General/HeavenlyBodyBuilder.cs @@ -41,14 +41,20 @@ namespace NewHorizons.Builder.General hb = AddHeavenlyBody(config.Name); } - if(!config.Orbit.IsStatic) + Planet.Plantoid planetoid; + + if (!config.Orbit.IsStatic) { - var planetoid = new Planet.Plantoid(size, gravity, body.transform.rotation, initialMotion._initAngularSpeed, parent, orbit); - - var mapping = Planet.defaultMapping; - mapping[hb] = planetoid; - Planet.defaultMapping = mapping; + planetoid = new Planet.Plantoid(size, gravity, body.transform.rotation, initialMotion._initAngularSpeed, parent, orbit); } + else + { + planetoid = new Planet.Plantoid(size, gravity, body.transform.rotation, 0f, HeavenlyBody.None, body.transform.position, Vector3.zero); + } + + var mapping = Planet.defaultMapping; + mapping[hb] = planetoid; + Planet.defaultMapping = mapping; // Fix for binary focal points var focalPoint = Position.AstroLookup[parent].Invoke()?.gameObject.GetComponent(); diff --git a/NewHorizons/NewHorizons.csproj b/NewHorizons/NewHorizons.csproj index e1139148..24dfca23 100644 --- a/NewHorizons/NewHorizons.csproj +++ b/NewHorizons/NewHorizons.csproj @@ -1,5 +1,4 @@ - - + {8A39F9E7-1A89-430C-9C3E-BDFB3B7E17DF} net48 @@ -33,27 +32,7 @@ $(OuterWildsModsDirectory)\PacificEngine.OW_CommonResources\PacificEngine.OW_CommonResources.dll - - - - rmdir /Q /S "$(OuterWildsModsDirectory)\$(ProjectName)" - md "$(OuterWildsModsDirectory)\$(ProjectName)" - md "$(OuterWildsModsDirectory)\$(ProjectName)\AssetBundle" - copy /y "$(ProjectDir)default-config.json" "$(OuterWildsModsDirectory)\$(ProjectName)" - copy /y "$(ProjectDir)manifest.json" "$(OuterWildsModsDirectory)\$(ProjectName)" - copy /y "$(ProjectDir)AssetBundle" "$(OuterWildsModsDirectory)\$(ProjectName)\AssetBundle" - copy /y "$(TargetPath)" "$(OuterWildsModsDirectory)\$(ProjectName)" - - rmdir /Q /S "$(ProjectDir)$(ProjectName)" - md "$(ProjectDir)$(ProjectName)" - md "$(ProjectDir)$(ProjectName)\AssetBundle" - copy /y "$(ProjectDir)default-config.json" "$(ProjectDir)$(ProjectName)" - copy /y "$(ProjectDir)manifest.json" "$(ProjectDir)$(ProjectName)" - copy /y "$(ProjectDir)AssetBundle" "$(ProjectDir)$(ProjectName)\AssetBundle" - copy /y "$(TargetPath)" "$(ProjectDir)$(ProjectName)" - del /q "$(ProjectDir)..\$(ProjectName).zip" - powershell Compress-Archive "$(ProjectDir)$(ProjectName)" "$(ProjectDir)..\$(ProjectName).zip" - rmdir /Q /S "$(ProjectDir)$(ProjectName)" - - + + + \ No newline at end of file