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

@@ -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