Prevent resources from spawning on ramps.

This commit is contained in:
Paul Chote
2015-04-21 01:09:32 +12:00
parent c4a63eee30
commit 098d69f120
2 changed files with 9 additions and 0 deletions

View File

@@ -31,6 +31,7 @@ namespace OpenRA.Traits
public readonly string[] AllowedTerrainTypes = { };
public readonly bool AllowUnderActors = false;
public readonly bool AllowUnderBuildings = false;
public readonly bool AllowOnRamps = false;
public PipType PipColor = PipType.Yellow;

View File

@@ -151,6 +151,14 @@ namespace OpenRA.Mods.Common.Traits
if (!rt.Info.AllowUnderBuildings && buildingInfluence.GetBuildingAt(cell) != null)
return false;
if (!rt.Info.AllowOnRamps)
{
var tile = world.Map.MapTiles.Value[cell];
var tileInfo = world.TileSet.GetTileInfo(tile);
if (tileInfo != null && tileInfo.RampType > 0)
return false;
}
return true;
}