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 ClientUnit = Client:ClientUnit()
|
||||
local ClientUnit = Client:GetClientGroupUnit()
|
||||
|
||||
return Valid
|
||||
end
|
||||
@ -497,7 +497,7 @@ trace.f(self.ClassName )
|
||||
|
||||
local Valid = true
|
||||
|
||||
local ClientUnit = Client:ClientUnit()
|
||||
local ClientUnit = Client:GetClientGroupUnit()
|
||||
|
||||
local CarrierPos = ClientUnit:getPoint()
|
||||
local CarrierPosMove = ClientUnit:getPoint()
|
||||
@ -632,8 +632,8 @@ trace.f( self.ClassName )
|
||||
if self.Client and self.Client:ClientGroup() then
|
||||
trace.i( self.ClassName, 'There is a Client ' .. self.Client.ClientName )
|
||||
if self.Client:FindCargo( self.CargoName ) then
|
||||
if self.Client:ClientUnit():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' )
|
||||
if self.Client:GetClientGroupUnit():getPlayerName() then -- this needs to be checked thoroughly
|
||||
trace.i( self.ClassName, 'ok, Client is of player ' .. self.Client:GetClientGroupUnit():getPlayerName() .. ' and contains the Cargo, do nothing' )
|
||||
SpawnCargo = false
|
||||
end
|
||||
end
|
||||
@ -686,7 +686,7 @@ trace.f(self.ClassName )
|
||||
|
||||
local Valid = true
|
||||
|
||||
local ClientUnit = Client:ClientUnit()
|
||||
local ClientUnit = Client:GetClientGroupUnit()
|
||||
|
||||
local CarrierPos = ClientUnit:getPoint()
|
||||
local CarrierPosMove = ClientUnit:getPoint()
|
||||
|
||||
@ -139,6 +139,8 @@ trace.f(self.ClassName)
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Returns the Unit of the @{CLIENT}.
|
||||
-- @treturn Unit
|
||||
function CLIENT:GetClientGroupUnit()
|
||||
trace.f(self.ClassName)
|
||||
|
||||
@ -156,20 +158,6 @@ trace.f(self.ClassName)
|
||||
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}.
|
||||
-- @treturn Position
|
||||
function CLIENT:ClientPosition()
|
||||
|
||||
@ -175,12 +175,12 @@ trace.f(self.ClassName)
|
||||
local AlivePlayers = ''
|
||||
for ClientID, Client in pairs( self._Clients ) do
|
||||
if Client:ClientGroup() then
|
||||
if Client:ClientGroupUnit() then
|
||||
if Client:ClientGroupUnit():getLife() > 0.0 then
|
||||
if Client:GetClientGroupUnit() then
|
||||
if Client:GetClientGroupUnit():getLife() > 0.0 then
|
||||
if AlivePlayers == '' then
|
||||
AlivePlayers = ' Players: ' .. Client:ClientGroupUnit():getPlayerName()
|
||||
AlivePlayers = ' Players: ' .. Client:GetClientGroupUnit():getPlayerName()
|
||||
else
|
||||
AlivePlayers = AlivePlayers .. ' / ' .. Client:ClientGroupUnit():getPlayerName()
|
||||
AlivePlayers = AlivePlayers .. ' / ' .. Client:GetClientGroupUnit():getPlayerName()
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -505,7 +505,7 @@ trace.scheduled("MISSIONSCHEDULER","Scheduler")
|
||||
if Mission.GoalFunction ~= nil then
|
||||
Mission.GoalFunction( Mission, Client )
|
||||
end
|
||||
_Database:_AddMissionTaskScore( Client:ClientGroupUnit(), Mission.Name, 25 )
|
||||
_Database:_AddMissionTaskScore( Client:GetClientGroupUnit(), Mission.Name, 25 )
|
||||
|
||||
-- if not Mission:IsCompleted() then
|
||||
-- end
|
||||
|
||||
@ -233,7 +233,7 @@ trace.f(self.ClassName)
|
||||
|
||||
local RouteMessage = "Fly to "
|
||||
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
|
||||
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
|
||||
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
|
||||
|
||||
@ -339,7 +339,7 @@ end
|
||||
function STAGELANDING:Validate( Mission, Client, Task )
|
||||
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
|
||||
|
||||
-- Client is in de landing zone.
|
||||
@ -365,7 +365,7 @@ trace.f(self.ClassName)
|
||||
return -1
|
||||
end
|
||||
|
||||
if Task.IsLandingRequired and Client:ClientUnit():inAir() then
|
||||
if Task.IsLandingRequired and Client:GetClientGroupUnit():inAir() then
|
||||
return 0
|
||||
end
|
||||
|
||||
@ -406,14 +406,14 @@ end
|
||||
function STAGELANDED:Validate( Mission, Client, Task )
|
||||
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." )
|
||||
Task.Signalled = false
|
||||
Task:RemoveCargoMenus( Client )
|
||||
return -2
|
||||
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." )
|
||||
Task.Signalled = false
|
||||
return -1
|
||||
@ -474,7 +474,7 @@ function STAGEUNLOAD:Validate( Mission, Client, Task )
|
||||
trace.f(self.ClassName)
|
||||
env.info( 'STAGEUNLOAD:Validate()' )
|
||||
|
||||
if routines.IsUnitInZones( Client:ClientUnit(), Task.CurrentLandingZoneName ) then
|
||||
if routines.IsUnitInZones( Client:GetClientGroupUnit(), Task.CurrentLandingZoneName ) then
|
||||
else
|
||||
Task.ExecuteStage = _TransportExecuteStage.FAILED
|
||||
Task:RemoveCargoMenus( Client )
|
||||
@ -483,7 +483,7 @@ trace.f(self.ClassName)
|
||||
return 1
|
||||
end
|
||||
|
||||
if not Client:ClientUnit():inAir() then
|
||||
if not Client:GetClientGroupUnit():inAir() then
|
||||
else
|
||||
Task.ExecuteStage = _TransportExecuteStage.FAILED
|
||||
Task:RemoveCargoMenus( Client )
|
||||
@ -592,7 +592,7 @@ trace.f(self.ClassName)
|
||||
trace.i( self.ClassName, "Task.CurrentLandingZoneName = " .. Task.CurrentLandingZoneName )
|
||||
|
||||
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.ExecuteStage = _TransportExecuteStage.FAILED
|
||||
Task.CargoName = nil
|
||||
@ -601,7 +601,7 @@ trace.f(self.ClassName)
|
||||
return -1
|
||||
end
|
||||
|
||||
if not Client:ClientUnit():inAir() then
|
||||
if not Client:GetClientGroupUnit():inAir() then
|
||||
else
|
||||
-- The carrier is back in the air, undo the loading process.
|
||||
Task:RemoveCargoMenus( Client )
|
||||
@ -715,7 +715,7 @@ trace.f(self.ClassName)
|
||||
|
||||
if Task.CargoName 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
|
||||
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
|
||||
@ -777,7 +777,7 @@ trace.f(self.ClassName)
|
||||
function STAGEARRIVE:Validate( Mission, Client, Task )
|
||||
trace.f(self.ClassName)
|
||||
|
||||
Task.CurrentLandingZoneID = routines.IsUnitInZones( Client:ClientUnit(), Task.LandingZones )
|
||||
Task.CurrentLandingZoneID = routines.IsUnitInZones( Client:GetClientGroupUnit(), Task.LandingZones )
|
||||
if ( Task.CurrentLandingZoneID ) then
|
||||
else
|
||||
return -1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user