diff --git a/OpenRA.Mods.RA/Scripting/Global/MapGlobal.cs b/OpenRA.Mods.RA/Scripting/Global/MapGlobal.cs index 2714bce6bc..54cbf1776f 100644 --- a/OpenRA.Mods.RA/Scripting/Global/MapGlobal.cs +++ b/OpenRA.Mods.RA/Scripting/Global/MapGlobal.cs @@ -86,6 +86,12 @@ namespace OpenRA.Mods.RA.Scripting return context.World.Map.ChooseRandomEdgeCell(context.World.SharedRandom); } + [Desc("Returns the center of a cell in world coordinates.")] + public WPos CenterOfCell(CPos cell) + { + return context.World.Map.CenterOfCell(cell); + } + [Desc("Returns true if there is only one human player.")] public bool IsSinglePlayer { get { return context.World.LobbyInfo.IsSinglePlayer; } } diff --git a/OpenRA.Mods.RA/Scripting/Global/UtilsGlobal.cs b/OpenRA.Mods.RA/Scripting/Global/UtilsGlobal.cs index 1530011bf5..7686a3bd95 100644 --- a/OpenRA.Mods.RA/Scripting/Global/UtilsGlobal.cs +++ b/OpenRA.Mods.RA/Scripting/Global/UtilsGlobal.cs @@ -89,11 +89,5 @@ namespace OpenRA.Mods.RA.Scripting return context.World.SharedRandom.Next(low, high); } - - [Desc("Returns the center of a cell in world coordinates.")] - public WPos CenterOfCell(CPos cell) - { - return context.World.Map.CenterOfCell(cell); - } } } diff --git a/mods/ra/maps/desert-shellmap/desert-shellmap.lua b/mods/ra/maps/desert-shellmap/desert-shellmap.lua index 00d804d6aa..0f16c9185a 100644 --- a/mods/ra/maps/desert-shellmap/desert-shellmap.lua +++ b/mods/ra/maps/desert-shellmap/desert-shellmap.lua @@ -84,8 +84,8 @@ end ParadropSovietUnits = function() local lz = Utils.Random(ParadropWaypoints).Location - local start = Utils.CenterOfCell(Map.RandomEdgeCell()) + WVec.New(0, 0, Actor.CruiseAltitude("badr")) - local transport = Actor.Create("badr", true, { CenterPosition = start, Owner = soviets, Facing = (Utils.CenterOfCell(lz) - start).Facing }) + local start = Map.CenterOfCell(Map.RandomEdgeCell()) + WVec.New(0, 0, Actor.CruiseAltitude("badr")) + local transport = Actor.Create("badr", true, { CenterPosition = start, Owner = soviets, Facing = (Map.CenterOfCell(lz) - start).Facing }) Utils.Do(ParadropUnitTypes, function(type) local a = Actor.Create(type, false, { Owner = soviets }) diff --git a/mods/ra/maps/intervention/intervention.lua b/mods/ra/maps/intervention/intervention.lua index fdb66f0c19..1c7d862900 100644 --- a/mods/ra/maps/intervention/intervention.lua +++ b/mods/ra/maps/intervention/intervention.lua @@ -48,7 +48,7 @@ Paratroopers = { "e1", "e1", "e1", "e3", "e3" } ParadropSovietUnits = function() local start = BaseRaidEntrypoint.CenterPosition + WVec.New(0, 0, Actor.CruiseAltitude("badr")) - local transport = Actor.Create("badr", true, { CenterPosition = start, Owner = soviets, Facing = (Utils.CenterOfCell(MCVDeployLocation.Location) - start).Facing }) + local transport = Actor.Create("badr", true, { CenterPosition = start, Owner = soviets, Facing = (Map.CenterOfCell(MCVDeployLocation.Location) - start).Facing }) Utils.Do(Paratroopers, function(type) local a = Actor.Create(type, false, { Owner = soviets }) @@ -66,8 +66,8 @@ AirRaid = function(planeTypes, ingress, egress, target) for i = 1, #planeTypes do Trigger.AfterDelay((i - 1) * DateTime.Seconds(1), function() - local start = Utils.CenterOfCell(ingress[1]) + WVec.New(0, 0, Actor.CruiseAltitude(planeTypes[i])) - local plane = Actor.Create(planeTypes[i], true, { CenterPosition = start, Owner = soviets, Facing = (Utils.CenterOfCell(ingress[2]) - start).Facing }) + local start = Map.CenterOfCell(ingress[1]) + WVec.New(0, 0, Actor.CruiseAltitude(planeTypes[i])) + local plane = Actor.Create(planeTypes[i], true, { CenterPosition = start, Owner = soviets, Facing = (Map.CenterOfCell(ingress[2]) - start).Facing }) Utils.Do(ingress, function(wpt) plane.Move(wpt) end) plane.Attack(target)