From fbcc4ee32b6750371184f6f53c23c0d971cf5276 Mon Sep 17 00:00:00 2001 From: Thomas <72444570+Applevangelist@users.noreply.github.com> Date: Sat, 11 Jan 2025 10:14:03 +0100 Subject: [PATCH] Update Unit.lua GetSTN fix if template os nil --- Moose Development/Moose/Wrapper/Unit.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Wrapper/Unit.lua b/Moose Development/Moose/Wrapper/Unit.lua index 9230eaeee..6bfd2eb45 100644 --- a/Moose Development/Moose/Wrapper/Unit.lua +++ b/Moose Development/Moose/Wrapper/Unit.lua @@ -1777,7 +1777,8 @@ function UNIT:GetSTN() local VCN = nil -- VoiceCallsignNumber local FGL = false -- FlightGroupLeader local template = self:GetTemplate() - if template.AddPropAircraft then + if template then + if template.AddPropAircraft then if template.AddPropAircraft.STN_L16 then STN = template.AddPropAircraft.STN_L16 elseif template.AddPropAircraft.SADL_TN then @@ -1793,6 +1794,6 @@ function UNIT:GetSTN() if template.datalinks and template.datalinks.SADL and template.datalinks.SADL.settings then FGL = template.datalinks.SADL.settings.flightLead end - + end return STN, VCL, VCN, FGL end