From 18fd3040d312f59c16329d363706922f6976af8f Mon Sep 17 00:00:00 2001 From: MOARdV Date: Sun, 6 May 2018 11:15:24 -0500 Subject: [PATCH] Fix lights illuminating the planet Remove layer 10 from the light's cull mask. Issue #10 --- GameData/AviationLights/Plugins/AviationLights.version | 2 +- README.md | 5 +++++ Source/AviationLights.cs | 3 +++ Source/Properties/AssemblyInfo.cs | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/GameData/AviationLights/Plugins/AviationLights.version b/GameData/AviationLights/Plugins/AviationLights.version index 68a2ec0..990e793 100644 --- a/GameData/AviationLights/Plugins/AviationLights.version +++ b/GameData/AviationLights/Plugins/AviationLights.version @@ -5,7 +5,7 @@ "VERSION": { "MAJOR": 4, "MINOR": 0, - "PATCH": 4 + "PATCH": 5 }, "KSP_VERSION": { "MAJOR": 1, diff --git a/README.md b/README.md index ff6f0e0..a9af70d 100644 --- a/README.md +++ b/README.md @@ -290,6 +290,11 @@ added to a config file or edited in the persistent.sfs file. ## CHANGELOG +6 May 2018 - v4.0.5 + +* Fixed: Aviation Lights illuminate the surface of the planet (Issue #10). + +*** 9 April 2018 - v4.0.4 * Fixed: Flashing lights blink rapidly after warp during flight (Issue #8). diff --git a/Source/AviationLights.cs b/Source/AviationLights.cs index 4695463..5555989 100644 --- a/Source/AviationLights.cs +++ b/Source/AviationLights.cs @@ -215,6 +215,9 @@ public void Start() mainLight.type = (spotLight) ? LightType.Spot : LightType.Point; mainLight.spotAngle = SpotAngle; } + // Remove layer 10 from the cullingMask - it's the layer KSP uses to draw planets while in + // orbit, and longer distances on the lights will illuminate the surface. + mainLight.cullingMask = (mainLight.cullingMask & ~(1 << 10)); UpdateMode(); diff --git a/Source/Properties/AssemblyInfo.cs b/Source/Properties/AssemblyInfo.cs index af777fc..e652a80 100644 --- a/Source/Properties/AssemblyInfo.cs +++ b/Source/Properties/AssemblyInfo.cs @@ -17,7 +17,7 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("4.0.4")] +[assembly: AssemblyVersion("4.0.5")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from