From 668ba51ba2281c56c635b34fe5bf0e7553dc36e1 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sat, 23 Dec 2023 14:50:57 +0100 Subject: [PATCH] xxx --- Moose Development/Moose/Functional/Range.lua | 4 +++- Moose Development/Moose/Ops/FlightControl.lua | 20 +++++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/Moose Development/Moose/Functional/Range.lua b/Moose Development/Moose/Functional/Range.lua index 8da132f14..5b4d52623 100644 --- a/Moose Development/Moose/Functional/Range.lua +++ b/Moose Development/Moose/Functional/Range.lua @@ -1737,7 +1737,9 @@ end -- @param Core.Event#EVENTDATA EventData function RANGE:OnEventBirth( EventData ) self:F( { eventbirth = EventData } ) - + + if not EventData.IniPlayerName then return end + local _unitName = EventData.IniUnitName local _unit, _playername = self:_GetPlayerUnitAndName( _unitName ) diff --git a/Moose Development/Moose/Ops/FlightControl.lua b/Moose Development/Moose/Ops/FlightControl.lua index 8403e0c24..112834e53 100644 --- a/Moose Development/Moose/Ops/FlightControl.lua +++ b/Moose Development/Moose/Ops/FlightControl.lua @@ -4424,14 +4424,11 @@ end -- Misc Functions ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---- Add parking guard in front of a parking aircraft. +--- [INTERNAL] Add parking guard in front of a parking aircraft - delayed for MP. -- @param #FLIGHTCONTROL self -- @param Wrapper.Unit#UNIT unit The aircraft. -function FLIGHTCONTROL:SpawnParkingGuard(unit) - - if unit and self.parkingGuard then - - -- Position of the unit. +function FLIGHTCONTROL:_SpawnParkingGuard(unit) + -- Position of the unit. local coordinate=unit:GetCoordinate() -- Parking spot. @@ -4478,6 +4475,17 @@ function FLIGHTCONTROL:SpawnParkingGuard(unit) else self:E(self.lid.."ERROR: Parking Guard already exists!") end +end + +--- Add parking guard in front of a parking aircraft. +-- @param #FLIGHTCONTROL self +-- @param Wrapper.Unit#UNIT unit The aircraft. +function FLIGHTCONTROL:SpawnParkingGuard(unit) + + if unit and self.parkingGuard then + + -- Schedule delay so in MP we get the heading of the client's plane + self:ScheduleOnce(1,FLIGHTCONTROL._SpawnParkingGuard,self,unit) end