Prevent resources from spawning on ramps.
This commit is contained in:
@@ -31,6 +31,7 @@ namespace OpenRA.Traits
|
|||||||
public readonly string[] AllowedTerrainTypes = { };
|
public readonly string[] AllowedTerrainTypes = { };
|
||||||
public readonly bool AllowUnderActors = false;
|
public readonly bool AllowUnderActors = false;
|
||||||
public readonly bool AllowUnderBuildings = false;
|
public readonly bool AllowUnderBuildings = false;
|
||||||
|
public readonly bool AllowOnRamps = false;
|
||||||
|
|
||||||
public PipType PipColor = PipType.Yellow;
|
public PipType PipColor = PipType.Yellow;
|
||||||
|
|
||||||
|
|||||||
@@ -151,6 +151,14 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (!rt.Info.AllowUnderBuildings && buildingInfluence.GetBuildingAt(cell) != null)
|
if (!rt.Info.AllowUnderBuildings && buildingInfluence.GetBuildingAt(cell) != null)
|
||||||
return false;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user