From da8341e3363386156344011833d24ccc8b8a8211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 28 Dec 2013 18:38:23 +0100 Subject: [PATCH] InitialAltitude is now part of CenterPositition in Lua, too followup of #4371 --- mods/common/lua/reinforcements.lua | 8 ++++---- mods/common/lua/rules.lua | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mods/common/lua/reinforcements.lua b/mods/common/lua/reinforcements.lua index 8d88de85be..4d1bae58ec 100644 --- a/mods/common/lua/reinforcements.lua +++ b/mods/common/lua/reinforcements.lua @@ -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) diff --git a/mods/common/lua/rules.lua b/mods/common/lua/rules.lua index 17d50b563c..fe9f0fe86f 100644 --- a/mods/common/lua/rules.lua +++ b/mods/common/lua/rules.lua @@ -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 \ No newline at end of file