From 2f913fc8b0d859045a1d3eab183c24cf90471f5b Mon Sep 17 00:00:00 2001 From: Joshua Thome Date: Tue, 18 Apr 2023 21:34:40 -0500 Subject: [PATCH 1/4] Fix NRE on spawned vessels with physics --- NewHorizons/Handlers/VesselWarpHandler.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/NewHorizons/Handlers/VesselWarpHandler.cs b/NewHorizons/Handlers/VesselWarpHandler.cs index 935c4399..91e52323 100644 --- a/NewHorizons/Handlers/VesselWarpHandler.cs +++ b/NewHorizons/Handlers/VesselWarpHandler.cs @@ -145,6 +145,7 @@ namespace NewHorizons.Handlers var hasParentBody = !string.IsNullOrEmpty(system.Config.Vessel?.vesselSpawn?.parentBody); var hasPhysics = system.Config.Vessel?.hasPhysics ?? !hasParentBody; + var planetGO = hasParentBody ? vesselObject.transform.parent.gameObject : null; if (hasPhysics) { @@ -167,8 +168,6 @@ namespace NewHorizons.Handlers var attachWarpExitToVessel = system.Config.Vessel?.warpExit?.attachToVessel ?? false; var warpExitParent = vesselWarpController._targetWarpPlatform.transform.parent; - var planetGO = hasPhysics ? vesselObject.transform.parent.gameObject : null; - var warpExit = GeneralPropBuilder.MakeFromExisting(vesselWarpController._targetWarpPlatform.gameObject, planetGO, null, system.Config.Vessel?.warpExit, parentOverride: attachWarpExitToVessel ? warpExitParent : null); if (attachWarpExitToVessel) { From d6ef4124800bf7d3b7bc75b3320b950e3c4b244b Mon Sep 17 00:00:00 2001 From: Joshua Thome Date: Tue, 18 Apr 2023 21:35:26 -0500 Subject: [PATCH 2/4] Make API call ignore remoteTrigger if radius is zero or negative --- NewHorizons/NewHorizonsApi.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NewHorizons/NewHorizonsApi.cs b/NewHorizons/NewHorizonsApi.cs index b34a741b..ee3ea62f 100644 --- a/NewHorizons/NewHorizonsApi.cs +++ b/NewHorizons/NewHorizonsApi.cs @@ -206,11 +206,11 @@ namespace NewHorizons radius = radius, range = range, xmlFile = xmlFile, - remoteTrigger = new RemoteTriggerInfo() + remoteTrigger = remoteTriggerRadius > 0f ? new RemoteTriggerInfo() { position = null, radius = remoteTriggerRadius, - }, + } : null, }; return DialogueBuilder.Make(root, null, info, mod); From 425be7d033442ea47ada6d6530644a048095ebdd Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 21 Apr 2023 22:56:17 -0400 Subject: [PATCH 3/4] Add a description to warp pad frequency --- NewHorizons/External/Modules/WarpPad/NomaiWarpPadInfo.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/NewHorizons/External/Modules/WarpPad/NomaiWarpPadInfo.cs b/NewHorizons/External/Modules/WarpPad/NomaiWarpPadInfo.cs index f4cd7515..94a9218d 100644 --- a/NewHorizons/External/Modules/WarpPad/NomaiWarpPadInfo.cs +++ b/NewHorizons/External/Modules/WarpPad/NomaiWarpPadInfo.cs @@ -5,6 +5,11 @@ namespace NewHorizons.External.Modules.WarpPad [JsonObject] public abstract class NomaiWarpPadInfo : GeneralPropInfo { + /// + /// This can be anything. To have a warp pad transmitter send you to a receiver you must give them the same frequency. + /// Try to make it something unique so it does not overlap with other warp pad pairs. + /// Futhermore, multiple transmitters can send you to the same receiver if they all have the same frequency. + /// public string frequency; } } From f82a04c4f80482e29d0e96583448ad0c027b4029 Mon Sep 17 00:00:00 2001 From: Ben C Date: Sat, 22 Apr 2023 02:58:30 +0000 Subject: [PATCH 4/4] Updated Schemas --- NewHorizons/Schemas/body_schema.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index 3ed03cf8..2e17f844 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -2440,7 +2440,8 @@ "additionalProperties": false, "properties": { "frequency": { - "type": "string" + "type": "string", + "description": "This can be anything. To have a warp pad transmitter send you to a receiver you must give them the same frequency. \nTry to make it something unique so it does not overlap with other warp pad pairs.\nFuthermore, multiple transmitters can send you to the same receiver if they all have the same frequency." }, "rotation": { "description": "Rotation of the object", @@ -2521,7 +2522,8 @@ "additionalProperties": false, "properties": { "frequency": { - "type": "string" + "type": "string", + "description": "This can be anything. To have a warp pad transmitter send you to a receiver you must give them the same frequency. \nTry to make it something unique so it does not overlap with other warp pad pairs.\nFuthermore, multiple transmitters can send you to the same receiver if they all have the same frequency." }, "rotation": { "description": "Rotation of the object",