From 7464406a17eabf4e1df4f13bd717cf0dc99b4125 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Wed, 31 Jan 2024 17:49:37 +0100 Subject: [PATCH 1/2] #SPAWN - Small fix for OnSpawnGroup() timing issues --- Moose Development/Moose/Core/Spawn.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Core/Spawn.lua b/Moose Development/Moose/Core/Spawn.lua index 8124e11a6..c7095dc8f 100644 --- a/Moose Development/Moose/Core/Spawn.lua +++ b/Moose Development/Moose/Core/Spawn.lua @@ -1689,8 +1689,8 @@ function SPAWN:SpawnWithIndex( SpawnIndex, NoBirth ) -- If there is a SpawnFunction hook defined, call it. if self.SpawnFunctionHook then - -- delay calling this for .1 seconds so that it hopefully comes after the BIRTH event of the group. - self.SpawnHookScheduler:Schedule( nil, self.SpawnFunctionHook, { self.SpawnGroups[self.SpawnIndex].Group, unpack( self.SpawnFunctionArguments ) }, 0.1 ) + -- delay calling this for .3 seconds so that it hopefully comes after the BIRTH event of the group. + self.SpawnHookScheduler:Schedule( nil, self.SpawnFunctionHook, { self.SpawnGroups[self.SpawnIndex].Group, unpack( self.SpawnFunctionArguments ) }, 0.3 ) end -- TODO: Need to fix this by putting an "R" in the name of the group when the group repeats. -- if self.Repeat then From 531132e8a733dfb2b93c622605f18565cf6241a2 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Wed, 31 Jan 2024 17:49:59 +0100 Subject: [PATCH 2/2] #GROUP small fix for GetAverageCoordinate() --- Moose Development/Moose/Wrapper/Group.lua | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Moose Development/Moose/Wrapper/Group.lua b/Moose Development/Moose/Wrapper/Group.lua index 080467e84..52741e2c2 100644 --- a/Moose Development/Moose/Wrapper/Group.lua +++ b/Moose Development/Moose/Wrapper/Group.lua @@ -1132,8 +1132,9 @@ function GROUP:GetAverageVec3() -- Average. local Vec3={x=x/n, y=y/n, z=z/n} --DCS#Vec3 return Vec3 - end - return nil + else + return self:GetVec3() + end end --- Returns a POINT_VEC2 object indicating the point in 2D of the first UNIT of the GROUP within the mission. @@ -1167,8 +1168,13 @@ function GROUP:GetAverageCoordinate() coord.Heading = Heading return coord else - BASE:E( { "Cannot GetAverageCoordinate", Group = self, Alive = self:IsAlive() } ) - return nil + local coord = self:GetCoordinate() + if coord then + return coord + else + BASE:E( { "Cannot GetAverageCoordinate", Group = self, Alive = self:IsAlive() } ) + return nil + end end end