AIRBOSS v0.2.3

group fixed init heading
This commit is contained in:
Frank 2018-11-11 23:55:19 +01:00
parent cf4be99093
commit 2d7d19880f
5 changed files with 1330 additions and 77 deletions

View File

@ -127,6 +127,7 @@ AI_FORMATION = {
-- @param Wrapper.Unit#UNIT FollowUnit The UNIT leading the FolllowGroupSet.
-- @param Core.Set#SET_GROUP FollowGroupSet The group AI escorting the FollowUnit.
-- @param #string FollowName Name of the escort.
-- @param #string FollowBriefing Briefing.
-- @return #AI_FORMATION self
function AI_FORMATION:New( FollowUnit, FollowGroupSet, FollowName, FollowBriefing ) --R2.1
local self = BASE:Inherit( self, FSM_SET:New( FollowGroupSet ) )

View File

@ -70,7 +70,7 @@ do -- UserFlag
-- local BlueVictory = USERFLAG:New( "VictoryBlue" )
-- 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 )
end

File diff suppressed because it is too large Load Diff

View File

@ -1798,7 +1798,10 @@ function WAREHOUSE:New(warehouse, alias)
-- Check if just a string was given and convert to static.
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
-- Nil check.

View File

@ -1482,6 +1482,17 @@ function GROUP:Respawn( Template, Reset )
if not Template then
Template = self:GetTemplate()
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
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].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].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] } )
end
end