From a798f2d61cfd75db862afc7e5fc88fd9d6c5f591 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Mon, 23 Sep 2024 12:43:39 +0200 Subject: [PATCH] Small fixes --- Moose Development/Moose/Core/Set.lua | 7 +++++-- Moose Development/Moose/Wrapper/DynamicCargo.lua | 7 ++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua index bc2bb0cd0..eeb7baf0e 100644 --- a/Moose Development/Moose/Core/Set.lua +++ b/Moose Development/Moose/Core/Set.lua @@ -8355,14 +8355,17 @@ do -- SET_SCENERY -- @param #SET_SCENERY self -- @return Core.Point#COORDINATE The center coordinate of all the objects in the set. function SET_SCENERY:GetCoordinate() - + --[[ local Coordinate = COORDINATE:New({0,0,0}) - + local Item = self:GetRandomSurely() if Item then Coordinate:GetCoordinate() end + --]] + + local Coordinate = self:GetFirst():GetCoordinate() local x1 = Coordinate.x local x2 = Coordinate.x diff --git a/Moose Development/Moose/Wrapper/DynamicCargo.lua b/Moose Development/Moose/Wrapper/DynamicCargo.lua index 63f341009..3ff7ddc53 100644 --- a/Moose Development/Moose/Wrapper/DynamicCargo.lua +++ b/Moose Development/Moose/Wrapper/DynamicCargo.lua @@ -458,7 +458,7 @@ function DYNAMICCARGO:_UpdatePosition() self:T(self.lid.." AGL: "..agl or -1) local isunloaded = true local client - local playername + local playername = self.Owner if count > 0 and (agl > 0 or self.testing) then self:T(self.lid.." Possible alive helos: "..count or -1) if agl ~= 0 or self.testing then @@ -470,6 +470,11 @@ function DYNAMICCARGO:_UpdatePosition() self.Owner = playername _DATABASE:CreateEventDynamicCargoUnloaded(self) end + elseif count > 0 and agl == 0 then + self:T(self.lid.." moved! LOADED -> UNLOADED by "..tostring(playername)) + self.CargoState = DYNAMICCARGO.State.UNLOADED + self.Owner = playername + _DATABASE:CreateEventDynamicCargoUnloaded(self) end end self.LastPosition = pos