Fix GiveUnitCrateAction being limited to MobileInfo

This commit is contained in:
abcdefg30
2017-02-09 13:11:01 +01:00
parent ac9c8b93a2
commit a385835939
5 changed files with 54 additions and 21 deletions

View File

@@ -97,11 +97,11 @@ namespace OpenRA.Mods.Common.Traits
IEnumerable<CPos> GetSuitableCells(CPos near, string unitName)
{
var mi = self.World.Map.Rules.Actors[unitName].TraitInfo<MobileInfo>();
var ip = self.World.Map.Rules.Actors[unitName].TraitInfo<IPositionableInfo>();
for (var i = -1; i < 2; i++)
for (var j = -1; j < 2; j++)
if (mi.CanEnterCell(self.World, self, near + new CVec(i, j)))
if (ip.CanEnterCell(self.World, self, near + new CVec(i, j)))
yield return near + new CVec(i, j);
}