mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
AIRBOSS v0.2.3
group fixed init heading
This commit is contained in:
@@ -127,6 +127,7 @@ AI_FORMATION = {
|
|||||||
-- @param Wrapper.Unit#UNIT FollowUnit The UNIT leading the FolllowGroupSet.
|
-- @param Wrapper.Unit#UNIT FollowUnit The UNIT leading the FolllowGroupSet.
|
||||||
-- @param Core.Set#SET_GROUP FollowGroupSet The group AI escorting the FollowUnit.
|
-- @param Core.Set#SET_GROUP FollowGroupSet The group AI escorting the FollowUnit.
|
||||||
-- @param #string FollowName Name of the escort.
|
-- @param #string FollowName Name of the escort.
|
||||||
|
-- @param #string FollowBriefing Briefing.
|
||||||
-- @return #AI_FORMATION self
|
-- @return #AI_FORMATION self
|
||||||
function AI_FORMATION:New( FollowUnit, FollowGroupSet, FollowName, FollowBriefing ) --R2.1
|
function AI_FORMATION:New( FollowUnit, FollowGroupSet, FollowName, FollowBriefing ) --R2.1
|
||||||
local self = BASE:Inherit( self, FSM_SET:New( FollowGroupSet ) )
|
local self = BASE:Inherit( self, FSM_SET:New( FollowGroupSet ) )
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ do -- UserFlag
|
|||||||
-- local BlueVictory = USERFLAG:New( "VictoryBlue" )
|
-- local BlueVictory = USERFLAG:New( "VictoryBlue" )
|
||||||
-- local BlueVictoryValue = BlueVictory:Get() -- Get the UserFlag VictoryBlue value.
|
-- local BlueVictoryValue = BlueVictory:Get() -- Get the UserFlag VictoryBlue value.
|
||||||
--
|
--
|
||||||
function USERFLAG:Get( Number ) --R2.3
|
function USERFLAG:Get() --R2.3
|
||||||
|
|
||||||
return trigger.misc.getUserFlag( self.UserFlagName )
|
return trigger.misc.getUserFlag( self.UserFlagName )
|
||||||
end
|
end
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1798,7 +1798,10 @@ function WAREHOUSE:New(warehouse, alias)
|
|||||||
|
|
||||||
-- Check if just a string was given and convert to static.
|
-- Check if just a string was given and convert to static.
|
||||||
if type(warehouse)=="string" then
|
if type(warehouse)=="string" then
|
||||||
warehouse=STATIC:FindByName(warehouse, true)
|
warehouse=GROUP:FindByName(warehouse)
|
||||||
|
if warehouse==nil then
|
||||||
|
warehouse=STATIC:FindByName(warehouse, true)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Nil check.
|
-- Nil check.
|
||||||
|
|||||||
@@ -1482,6 +1482,17 @@ function GROUP:Respawn( Template, Reset )
|
|||||||
if not Template then
|
if not Template then
|
||||||
Template = self:GetTemplate()
|
Template = self:GetTemplate()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Get correct heading.
|
||||||
|
local function _Heading(course)
|
||||||
|
local h
|
||||||
|
if course<=180 then
|
||||||
|
h=math.rad(course)
|
||||||
|
else
|
||||||
|
h=-math.rad(360-course)
|
||||||
|
end
|
||||||
|
return h
|
||||||
|
end
|
||||||
|
|
||||||
if self:IsAlive() then
|
if self:IsAlive() then
|
||||||
local Zone = self.InitRespawnZone -- Core.Zone#ZONE
|
local Zone = self.InitRespawnZone -- Core.Zone#ZONE
|
||||||
@@ -1515,7 +1526,8 @@ function GROUP:Respawn( Template, Reset )
|
|||||||
Template.units[UnitID].alt = self.InitRespawnHeight and self.InitRespawnHeight or GroupUnitVec3.y
|
Template.units[UnitID].alt = self.InitRespawnHeight and self.InitRespawnHeight or GroupUnitVec3.y
|
||||||
Template.units[UnitID].x = ( Template.units[UnitID].x - From.x ) + GroupUnitVec3.x -- Keep the original x position of the template and translate to the new position.
|
Template.units[UnitID].x = ( Template.units[UnitID].x - From.x ) + GroupUnitVec3.x -- Keep the original x position of the template and translate to the new position.
|
||||||
Template.units[UnitID].y = ( Template.units[UnitID].y - From.y ) + GroupUnitVec3.z -- Keep the original z position of the template and translate to the new position.
|
Template.units[UnitID].y = ( Template.units[UnitID].y - From.y ) + GroupUnitVec3.z -- Keep the original z position of the template and translate to the new position.
|
||||||
Template.units[UnitID].heading = self.InitRespawnHeading and self.InitRespawnHeading or GroupUnit:GetHeading()
|
Template.units[UnitID].heading = _Heading(self.InitRespawnHeading and self.InitRespawnHeading or GroupUnit:GetHeading())
|
||||||
|
Template.units[UnitID].psi = -Template.units[UnitID].heading
|
||||||
self:F( { UnitID, Template.units[UnitID], Template.units[UnitID] } )
|
self:F( { UnitID, Template.units[UnitID], Template.units[UnitID] } )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user