Move ChooseRandomCell from WorldUtils to Map
This commit is contained in:
@@ -114,7 +114,7 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
for (var n = 0; n < maxTries; n++)
|
||||
{
|
||||
var p = self.World.ChooseRandomCell(self.World.SharedRandom);
|
||||
var p = self.World.Map.ChooseRandomCell(self.World.SharedRandom);
|
||||
|
||||
// Is this valid terrain?
|
||||
var terrainType = self.World.Map.GetTerrainInfo(p).Type;
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace OpenRA.Mods.RA.Scripting
|
||||
[Desc("Returns a random cell inside the visible region of the map.")]
|
||||
public CPos RandomCell()
|
||||
{
|
||||
return context.World.ChooseRandomCell(context.World.SharedRandom);
|
||||
return context.World.Map.ChooseRandomCell(context.World.SharedRandom);
|
||||
}
|
||||
|
||||
[Desc("Returns a random cell on the visible border of the map.")]
|
||||
|
||||
@@ -339,7 +339,7 @@ namespace OpenRA.Mods.RA.Scripting
|
||||
[LuaGlobal]
|
||||
public CPos GetRandomCell()
|
||||
{
|
||||
return world.ChooseRandomCell(world.SharedRandom);
|
||||
return world.Map.ChooseRandomCell(world.SharedRandom);
|
||||
}
|
||||
|
||||
[LuaGlobal]
|
||||
|
||||
Reference in New Issue
Block a user