Merge pull request #8038 from pchote/resource-slopes

Prevent resources from spawning on ramps.
This commit is contained in:
Matthias Mailänder
2015-04-27 21:24:09 +02:00
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;
}