Fixed stuff for multi player

This commit is contained in:
FlightControl_Master 2018-04-11 17:00:11 +02:00
parent 1ae1b9abd7
commit faa934ffce
7 changed files with 16 additions and 22 deletions

View File

@ -610,7 +610,7 @@ do -- CARGO
-- @param #number NearRadius The radius when the cargo will board the Carrier (to avoid collision).
-- @return #boolean
function CARGO:IsNear( PointVec2, NearRadius )
self:F2( { PointVec2 = PointVec2, NearRadius = NearRadius } )
--self:F2( { PointVec2 = PointVec2, NearRadius = NearRadius } )
if self.CargoObject:IsAlive() then
--local Distance = PointVec2:DistanceFromPointVec2( self.CargoObject:GetPointVec2() )
@ -621,12 +621,12 @@ do -- CARGO
--self:F( Distance )
if Distance <= NearRadius then
self:F( { PointVec2 = PointVec2, NearRadius = NearRadius, IsNear = true } )
--self:F( { PointVec2 = PointVec2, NearRadius = NearRadius, IsNear = true } )
return true
end
end
self:F( { PointVec2 = PointVec2, NearRadius = NearRadius, IsNear = false } )
--self:F( { PointVec2 = PointVec2, NearRadius = NearRadius, IsNear = false } )
return false
end

View File

@ -51,8 +51,6 @@ do -- CARGO_CRATE
self.CargoObject = CargoStatic -- Wrapper.Static#STATIC
self:T( self.ClassName )
-- Cargo objects are added to the _DATABASE and SET_CARGO objects.
_EVENTDISPATCHER:CreateEventNewCargo( self )
@ -103,7 +101,7 @@ do -- CARGO_CRATE
-- @param #string To
-- @param Core.Point#POINT_VEC2
function CARGO_CRATE:onenterUnLoaded( From, Event, To, ToPointVec2 )
self:F( { ToPointVec2, From, Event, To } )
--self:F( { ToPointVec2, From, Event, To } )
local Angle = 180
local Speed = 10
@ -140,7 +138,7 @@ do -- CARGO_CRATE
-- @param #string To
-- @param Wrapper.Unit#UNIT CargoCarrier
function CARGO_CRATE:onenterLoaded( From, Event, To, CargoCarrier )
self:F( { From, Event, To, CargoCarrier } )
--self:F( { From, Event, To, CargoCarrier } )
self.CargoCarrier = CargoCarrier
@ -171,12 +169,12 @@ do -- CARGO_CRATE
-- @param Core.Point#Coordinate Coordinate
-- @return #boolean true if the Cargo Crate is within the report radius.
function CARGO_CRATE:IsInReportRadius( Coordinate )
self:F( { Coordinate, LoadRadius = self.LoadRadius } )
--self:F( { Coordinate, LoadRadius = self.LoadRadius } )
local Distance = 0
if self:IsUnLoaded() then
Distance = Coordinate:DistanceFromPointVec2( self.CargoObject:GetPointVec2() )
self:T( Distance )
--self:T( Distance )
if Distance <= self.LoadRadius then
return true
end
@ -191,12 +189,12 @@ do -- CARGO_CRATE
-- @param Core.Point#Coordinate Coordinate
-- @return #boolean true if the Cargo Crate is within the loading radius.
function CARGO_CRATE:IsInLoadRadius( Coordinate )
self:F( { Coordinate, LoadRadius = self.NearRadius } )
--self:F( { Coordinate, LoadRadius = self.NearRadius } )
local Distance = 0
if self:IsUnLoaded() then
Distance = Coordinate:DistanceFromPointVec2( self.CargoObject:GetPointVec2() )
self:T( Distance )
--self:T( Distance )
if Distance <= self.NearRadius then
return true
end
@ -212,7 +210,7 @@ do -- CARGO_CRATE
-- @return Core.Point#COORDINATE The current Coordinate of the first Cargo of the CargoGroup.
-- @return #nil There is no valid Cargo in the CargoGroup.
function CARGO_CRATE:GetCoordinate()
self:F()
--self:F()
return self.CargoObject:GetCoordinate()
end

View File

@ -285,7 +285,7 @@ do -- CARGO_UNIT
-- @param Wrapper.Client#CLIENT CargoCarrier
-- @param #number NearRadius
function CARGO_UNIT:onafterBoarding( From, Event, To, CargoCarrier, NearRadius, ... )
self:F( { From, Event, To, CargoCarrier.UnitName, NearRadius } )
--self:F( { From, Event, To, CargoCarrier.UnitName, NearRadius } )
if CargoCarrier and CargoCarrier:IsAlive() and self.CargoObject and self.CargoObject:IsAlive() then
@ -338,7 +338,7 @@ do -- CARGO_UNIT
-- @param #string To
-- @param Wrapper.Unit#UNIT CargoCarrier
function CARGO_UNIT:onenterBoarding( From, Event, To, CargoCarrier, NearRadius, ... )
self:F( { From, Event, To, CargoCarrier.UnitName, NearRadius } )
--self:F( { From, Event, To, CargoCarrier.UnitName, NearRadius } )
local Speed = 90
local Angle = 180

View File

@ -246,7 +246,7 @@ do -- MENU_BASE
-- @param #boolean RemoveParent If true, the parent menu is automatically removed when this menu is the last child menu of that parent @{Menu}.
-- @return #MENU_BASE
function MENU_BASE:SetRemoveParent( RemoveParent )
self:F( { RemoveParent } )
--self:F( { RemoveParent } )
self.MenuRemoveParent = RemoveParent
return self
end

View File

@ -1624,11 +1624,7 @@ do -- Task Control Menu
TaskName = TaskName or ""
if not self.TaskControlMenu then
self.TaskControlMenu = MENU_GROUP:New( TaskUnit:GetGroup(), "Assigned Task " .. TaskUnit:GetPlayerName() .. " - " .. self:GetName() .. " " .. TaskName ):SetTime( self.TaskControlMenuTime )
else
self.TaskControlMenu:SetTime( self.TaskControlMenuTime )
end
return self.TaskControlMenu
end

View File

@ -329,7 +329,7 @@ do -- TASK_CARGO
if Cargo:IsInLoadRadius( TaskUnit:GetPointVec2() ) then
Cargo:Report( "Ready for slingloading.", "slingload", TaskUnit:GetGroup() )
else
Cargo:Report( "Slingload at " .. Cargo:GetCoordinate():ToString( TaskUnit:GetGroup() .. "." ), "reporting", TaskUnit:GetGroup() )
Cargo:Report( "Slingload at " .. Cargo:GetCoordinate():ToString( TaskUnit:GetGroup() ) .. ".", "reporting", TaskUnit:GetGroup() )
end
end
end

View File

@ -129,7 +129,7 @@ function POSITIONABLE:GetPointVec2()
local PositionablePointVec2 = POINT_VEC2:NewFromVec3( PositionableVec3 )
self:T( PositionablePointVec2 )
--self:F( PositionablePointVec2 )
return PositionablePointVec2
end