fix crates dropping on buildings etc
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user