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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user