InitialAltitude is now part of CenterPositition in Lua, too
followup of #4371
This commit is contained in:
@@ -2,8 +2,8 @@ Reinforcements = { }
|
||||
|
||||
Reinforcements.Insert = function(owner, transportName, passengerNames, enterPath, exitPath)
|
||||
local facing = { Map.GetFacing(CPos.op_Subtraction(enterPath[2], enterPath[1]), 0), "Int32" }
|
||||
local altitude = { Rules.InitialAltitude(transportName), "Int32" }
|
||||
local transport = Actor.Create(transportName, { Owner = owner, Location = enterPath[1], Facing = facing, Altitude = altitude })
|
||||
local center = WPos.op_Addition(enterPath[1].CenterPosition, WVec.New(0, 0, Rules.InitialAltitude(transportName)))
|
||||
local transport = Actor.Create(transportName, { Owner = owner, Location = enterPath[1], CenterPosition = center, Facing = facing })
|
||||
local cargo = Actor.Trait(transport, "Cargo")
|
||||
local passengers = { }
|
||||
|
||||
@@ -24,8 +24,8 @@ end
|
||||
|
||||
Reinforcements.Extract = function(owner, transportName, passengerNames, enterPath, exitPath)
|
||||
local facing = { Map.GetFacing(CPos.op_Subtraction(enterPath[2], enterPath[1]), 0), "Int32" }
|
||||
local altitude = { Rules.InitialAltitude(transportName), "Int32" }
|
||||
local transport = Actor.Create(transportName, { Owner = owner, Location = enterPath[1], Facing = facing, Altitude = altitude })
|
||||
local center = WPos.op_Addition(enterPath[1].CenterPosition, WVec.New(0, 0, Rules.InitialAltitude(transportName)))
|
||||
local transport = Actor.Create(transportName, { Owner = owner, Location = enterPath[1], CenterPosition = center, Facing = facing })
|
||||
local cargo = Actor.Trait(transport, "Cargo")
|
||||
|
||||
Utils.Do(Utils.Skip(enterPath, 1), function(l) Actor.ScriptedMove(transport, l) end)
|
||||
|
||||
@@ -15,7 +15,7 @@ end
|
||||
Rules.InitialAltitude = function(actorType)
|
||||
local ai = Rules.TraitInfoOrDefault(actorType, "AircraftInfo")
|
||||
if ai ~= nil then
|
||||
return ai.CruiseAltitude
|
||||
return ai.CruiseAltitude.Range
|
||||
end
|
||||
return 0
|
||||
end
|
||||
Reference in New Issue
Block a user