fix crates dropping on buildings etc

This commit is contained in:
Chris Forbes
2011-03-05 12:00:28 +13:00
parent a676bdae71
commit a1f1b5882e

View File

@@ -11,7 +11,8 @@
using System.Collections.Generic;
using System.Linq;
using OpenRA.FileFormats;
using OpenRA.Traits;
using OpenRA.Traits;
using OpenRA.Mods.RA.Buildings;
/*
* Crates left to implement:
@@ -94,8 +95,14 @@ namespace OpenRA.Mods.RA
public bool CanEnterCell(int2 cell)
{
if (!self.World.Map.IsInMap(cell.X, cell.Y)) return false;
var type = self.World.GetTerrainType(cell);
return Info.TerrainTypes.Contains(type);
var type = self.World.GetTerrainType(cell);
if (!Info.TerrainTypes.Contains(type))
return false;
if (self.World.WorldActor.Trait<BuildingInfluence>().GetBuildingAt(cell) != null) return false;
if (self.World.WorldActor.Trait<UnitInfluence>().GetUnitsAt(cell).Any()) return false;
return true;
}
public void SetPosition(Actor self, int2 cell)