mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Bug fix 1.5
This commit is contained in:
parent
357dd87c03
commit
fd0d012ff5
@ -347,7 +347,7 @@ trace.f(self.ClassName )
|
|||||||
|
|
||||||
local Valid = true
|
local Valid = true
|
||||||
|
|
||||||
local ClientUnit = Client:ClientUnit()
|
local ClientUnit = Client:GetClientGroupUnit()
|
||||||
|
|
||||||
return Valid
|
return Valid
|
||||||
end
|
end
|
||||||
@ -497,7 +497,7 @@ trace.f(self.ClassName )
|
|||||||
|
|
||||||
local Valid = true
|
local Valid = true
|
||||||
|
|
||||||
local ClientUnit = Client:ClientUnit()
|
local ClientUnit = Client:GetClientGroupUnit()
|
||||||
|
|
||||||
local CarrierPos = ClientUnit:getPoint()
|
local CarrierPos = ClientUnit:getPoint()
|
||||||
local CarrierPosMove = ClientUnit:getPoint()
|
local CarrierPosMove = ClientUnit:getPoint()
|
||||||
@ -632,8 +632,8 @@ trace.f( self.ClassName )
|
|||||||
if self.Client and self.Client:ClientGroup() then
|
if self.Client and self.Client:ClientGroup() then
|
||||||
trace.i( self.ClassName, 'There is a Client ' .. self.Client.ClientName )
|
trace.i( self.ClassName, 'There is a Client ' .. self.Client.ClientName )
|
||||||
if self.Client:FindCargo( self.CargoName ) then
|
if self.Client:FindCargo( self.CargoName ) then
|
||||||
if self.Client:ClientUnit():getPlayerName() then -- this needs to be checked thoroughly
|
if self.Client:GetClientGroupUnit():getPlayerName() then -- this needs to be checked thoroughly
|
||||||
trace.i( self.ClassName, 'ok, Client is of player ' .. self.Client:ClientUnit():getPlayerName() .. ' and contains the Cargo, do nothing' )
|
trace.i( self.ClassName, 'ok, Client is of player ' .. self.Client:GetClientGroupUnit():getPlayerName() .. ' and contains the Cargo, do nothing' )
|
||||||
SpawnCargo = false
|
SpawnCargo = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -686,7 +686,7 @@ trace.f(self.ClassName )
|
|||||||
|
|
||||||
local Valid = true
|
local Valid = true
|
||||||
|
|
||||||
local ClientUnit = Client:ClientUnit()
|
local ClientUnit = Client:GetClientGroupUnit()
|
||||||
|
|
||||||
local CarrierPos = ClientUnit:getPoint()
|
local CarrierPos = ClientUnit:getPoint()
|
||||||
local CarrierPosMove = ClientUnit:getPoint()
|
local CarrierPosMove = ClientUnit:getPoint()
|
||||||
|
|||||||
@ -139,6 +139,8 @@ trace.f(self.ClassName)
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Returns the Unit of the @{CLIENT}.
|
||||||
|
-- @treturn Unit
|
||||||
function CLIENT:GetClientGroupUnit()
|
function CLIENT:GetClientGroupUnit()
|
||||||
trace.f(self.ClassName)
|
trace.f(self.ClassName)
|
||||||
|
|
||||||
@ -156,20 +158,6 @@ trace.f(self.ClassName)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Returns the Unit of the @{CLIENT}.
|
|
||||||
-- @treturn Unit
|
|
||||||
function CLIENT:ClientUnit()
|
|
||||||
--trace.f(self.ClassName)
|
|
||||||
local ClientData = Group.getByName( self.ClientName )
|
|
||||||
if ClientData and ClientData:isExist() then
|
|
||||||
trace.i( self.ClassName, self.ClientName .. " : group found!" )
|
|
||||||
return ClientData:getUnits()[1]
|
|
||||||
else
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
--- Returns the Position of the @{CLIENT}.
|
--- Returns the Position of the @{CLIENT}.
|
||||||
-- @treturn Position
|
-- @treturn Position
|
||||||
function CLIENT:ClientPosition()
|
function CLIENT:ClientPosition()
|
||||||
|
|||||||
@ -175,12 +175,12 @@ trace.f(self.ClassName)
|
|||||||
local AlivePlayers = ''
|
local AlivePlayers = ''
|
||||||
for ClientID, Client in pairs( self._Clients ) do
|
for ClientID, Client in pairs( self._Clients ) do
|
||||||
if Client:ClientGroup() then
|
if Client:ClientGroup() then
|
||||||
if Client:ClientGroupUnit() then
|
if Client:GetClientGroupUnit() then
|
||||||
if Client:ClientGroupUnit():getLife() > 0.0 then
|
if Client:GetClientGroupUnit():getLife() > 0.0 then
|
||||||
if AlivePlayers == '' then
|
if AlivePlayers == '' then
|
||||||
AlivePlayers = ' Players: ' .. Client:ClientGroupUnit():getPlayerName()
|
AlivePlayers = ' Players: ' .. Client:GetClientGroupUnit():getPlayerName()
|
||||||
else
|
else
|
||||||
AlivePlayers = AlivePlayers .. ' / ' .. Client:ClientGroupUnit():getPlayerName()
|
AlivePlayers = AlivePlayers .. ' / ' .. Client:GetClientGroupUnit():getPlayerName()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -505,7 +505,7 @@ trace.scheduled("MISSIONSCHEDULER","Scheduler")
|
|||||||
if Mission.GoalFunction ~= nil then
|
if Mission.GoalFunction ~= nil then
|
||||||
Mission.GoalFunction( Mission, Client )
|
Mission.GoalFunction( Mission, Client )
|
||||||
end
|
end
|
||||||
_Database:_AddMissionTaskScore( Client:ClientGroupUnit(), Mission.Name, 25 )
|
_Database:_AddMissionTaskScore( Client:GetClientGroupUnit(), Mission.Name, 25 )
|
||||||
|
|
||||||
-- if not Mission:IsCompleted() then
|
-- if not Mission:IsCompleted() then
|
||||||
-- end
|
-- end
|
||||||
|
|||||||
@ -233,7 +233,7 @@ trace.f(self.ClassName)
|
|||||||
|
|
||||||
local RouteMessage = "Fly to "
|
local RouteMessage = "Fly to "
|
||||||
for LandingZoneID, LandingZoneName in pairs( Task.LandingZones.LandingZoneNames ) do
|
for LandingZoneID, LandingZoneName in pairs( Task.LandingZones.LandingZoneNames ) do
|
||||||
RouteMessage = RouteMessage .. LandingZoneName .. ' at ' .. routines.getBRStringZone( { zone = LandingZoneName, ref = Client:ClientGroupUnit():getPoint(), true, true } ) .. ' km. '
|
RouteMessage = RouteMessage .. LandingZoneName .. ' at ' .. routines.getBRStringZone( { zone = LandingZoneName, ref = Client:GetClientGroupUnit():getPoint(), true, true } ) .. ' km. '
|
||||||
end
|
end
|
||||||
Client:Message( RouteMessage, self.MSG.TIME, Mission.Name .. "/StageRoute", "Co-Pilot: Route", 20 )
|
Client:Message( RouteMessage, self.MSG.TIME, Mission.Name .. "/StageRoute", "Co-Pilot: Route", 20 )
|
||||||
|
|
||||||
@ -250,7 +250,7 @@ trace.f(self.ClassName)
|
|||||||
|
|
||||||
-- check if the Client is in the landing zone
|
-- check if the Client is in the landing zone
|
||||||
trace.i( self.ClassName, Task.LandingZones.LandingZoneNames )
|
trace.i( self.ClassName, Task.LandingZones.LandingZoneNames )
|
||||||
Task.CurrentLandingZoneName = routines.IsUnitInZones( Client:ClientUnit(), Task.LandingZones.LandingZoneNames )
|
Task.CurrentLandingZoneName = routines.IsUnitInZones( Client:GetClientGroupUnit(), Task.LandingZones.LandingZoneNames )
|
||||||
|
|
||||||
if Task.CurrentLandingZoneName then
|
if Task.CurrentLandingZoneName then
|
||||||
|
|
||||||
@ -339,7 +339,7 @@ end
|
|||||||
function STAGELANDING:Validate( Mission, Client, Task )
|
function STAGELANDING:Validate( Mission, Client, Task )
|
||||||
trace.f(self.ClassName)
|
trace.f(self.ClassName)
|
||||||
|
|
||||||
Task.CurrentLandingZoneName = routines.IsUnitInZones( Client:ClientUnit(), Task.LandingZones.LandingZoneNames )
|
Task.CurrentLandingZoneName = routines.IsUnitInZones( Client:GetClientGroupUnit(), Task.LandingZones.LandingZoneNames )
|
||||||
if Task.CurrentLandingZoneName then
|
if Task.CurrentLandingZoneName then
|
||||||
|
|
||||||
-- Client is in de landing zone.
|
-- Client is in de landing zone.
|
||||||
@ -365,7 +365,7 @@ trace.f(self.ClassName)
|
|||||||
return -1
|
return -1
|
||||||
end
|
end
|
||||||
|
|
||||||
if Task.IsLandingRequired and Client:ClientUnit():inAir() then
|
if Task.IsLandingRequired and Client:GetClientGroupUnit():inAir() then
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -406,14 +406,14 @@ end
|
|||||||
function STAGELANDED:Validate( Mission, Client, Task )
|
function STAGELANDED:Validate( Mission, Client, Task )
|
||||||
trace.f(self.ClassName)
|
trace.f(self.ClassName)
|
||||||
|
|
||||||
if not routines.IsUnitInZones( Client:ClientUnit(), Task.CurrentLandingZoneName ) then
|
if not routines.IsUnitInZones( Client:GetClientGroupUnit(), Task.CurrentLandingZoneName ) then
|
||||||
trace.i( self.ClassName, "Client is not anymore in the landing zone, go back to stage Route, and remove cargo menus." )
|
trace.i( self.ClassName, "Client is not anymore in the landing zone, go back to stage Route, and remove cargo menus." )
|
||||||
Task.Signalled = false
|
Task.Signalled = false
|
||||||
Task:RemoveCargoMenus( Client )
|
Task:RemoveCargoMenus( Client )
|
||||||
return -2
|
return -2
|
||||||
end
|
end
|
||||||
|
|
||||||
if Task.IsLandingRequired and Client:ClientUnit():inAir() then
|
if Task.IsLandingRequired and Client:GetClientGroupUnit():inAir() then
|
||||||
trace.i( self.ClassName, "Client went back in the air. Go back to stage Landing." )
|
trace.i( self.ClassName, "Client went back in the air. Go back to stage Landing." )
|
||||||
Task.Signalled = false
|
Task.Signalled = false
|
||||||
return -1
|
return -1
|
||||||
@ -474,7 +474,7 @@ function STAGEUNLOAD:Validate( Mission, Client, Task )
|
|||||||
trace.f(self.ClassName)
|
trace.f(self.ClassName)
|
||||||
env.info( 'STAGEUNLOAD:Validate()' )
|
env.info( 'STAGEUNLOAD:Validate()' )
|
||||||
|
|
||||||
if routines.IsUnitInZones( Client:ClientUnit(), Task.CurrentLandingZoneName ) then
|
if routines.IsUnitInZones( Client:GetClientGroupUnit(), Task.CurrentLandingZoneName ) then
|
||||||
else
|
else
|
||||||
Task.ExecuteStage = _TransportExecuteStage.FAILED
|
Task.ExecuteStage = _TransportExecuteStage.FAILED
|
||||||
Task:RemoveCargoMenus( Client )
|
Task:RemoveCargoMenus( Client )
|
||||||
@ -483,7 +483,7 @@ trace.f(self.ClassName)
|
|||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
if not Client:ClientUnit():inAir() then
|
if not Client:GetClientGroupUnit():inAir() then
|
||||||
else
|
else
|
||||||
Task.ExecuteStage = _TransportExecuteStage.FAILED
|
Task.ExecuteStage = _TransportExecuteStage.FAILED
|
||||||
Task:RemoveCargoMenus( Client )
|
Task:RemoveCargoMenus( Client )
|
||||||
@ -592,7 +592,7 @@ trace.f(self.ClassName)
|
|||||||
trace.i( self.ClassName, "Task.CurrentLandingZoneName = " .. Task.CurrentLandingZoneName )
|
trace.i( self.ClassName, "Task.CurrentLandingZoneName = " .. Task.CurrentLandingZoneName )
|
||||||
|
|
||||||
if not Task.IsSlingLoad then
|
if not Task.IsSlingLoad then
|
||||||
if not routines.IsUnitInZones( Client:ClientUnit(), Task.CurrentLandingZoneName ) then
|
if not routines.IsUnitInZones( Client:GetClientGroupUnit(), Task.CurrentLandingZoneName ) then
|
||||||
Task:RemoveCargoMenus( Client )
|
Task:RemoveCargoMenus( Client )
|
||||||
Task.ExecuteStage = _TransportExecuteStage.FAILED
|
Task.ExecuteStage = _TransportExecuteStage.FAILED
|
||||||
Task.CargoName = nil
|
Task.CargoName = nil
|
||||||
@ -601,7 +601,7 @@ trace.f(self.ClassName)
|
|||||||
return -1
|
return -1
|
||||||
end
|
end
|
||||||
|
|
||||||
if not Client:ClientUnit():inAir() then
|
if not Client:GetClientGroupUnit():inAir() then
|
||||||
else
|
else
|
||||||
-- The carrier is back in the air, undo the loading process.
|
-- The carrier is back in the air, undo the loading process.
|
||||||
Task:RemoveCargoMenus( Client )
|
Task:RemoveCargoMenus( Client )
|
||||||
@ -715,7 +715,7 @@ trace.f(self.ClassName)
|
|||||||
|
|
||||||
if Task.CargoName then
|
if Task.CargoName then
|
||||||
if not StaticObject.getByName( Task.CargoName ):inAir() then
|
if not StaticObject.getByName( Task.CargoName ):inAir() then
|
||||||
if routines.IsUnitInZones( Client:ClientUnit(), Task.CurrentLandingZoneName ) then
|
if routines.IsUnitInZones( Client:GetClientGroupUnit(), Task.CurrentLandingZoneName ) then
|
||||||
else
|
else
|
||||||
Client:Message( 'Co-Pilot: The Cargo is Dropped in the Landing Zone, and You have flown outside of the landing zone.', self.MSG.TIME, Mission.Name .. "/Stage" )
|
Client:Message( 'Co-Pilot: The Cargo is Dropped in the Landing Zone, and You have flown outside of the landing zone.', self.MSG.TIME, Mission.Name .. "/Stage" )
|
||||||
return 1
|
return 1
|
||||||
@ -777,7 +777,7 @@ trace.f(self.ClassName)
|
|||||||
function STAGEARRIVE:Validate( Mission, Client, Task )
|
function STAGEARRIVE:Validate( Mission, Client, Task )
|
||||||
trace.f(self.ClassName)
|
trace.f(self.ClassName)
|
||||||
|
|
||||||
Task.CurrentLandingZoneID = routines.IsUnitInZones( Client:ClientUnit(), Task.LandingZones )
|
Task.CurrentLandingZoneID = routines.IsUnitInZones( Client:GetClientGroupUnit(), Task.LandingZones )
|
||||||
if ( Task.CurrentLandingZoneID ) then
|
if ( Task.CurrentLandingZoneID ) then
|
||||||
else
|
else
|
||||||
return -1
|
return -1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user