Fixed UnloadCargo stacking using new subcell API exposure

This commit is contained in:
atlimit8
2014-08-08 14:27:54 -05:00
parent 9efcf231e1
commit ff7ad53dee
8 changed files with 35 additions and 12 deletions

View File

@@ -28,7 +28,11 @@ namespace OpenRA.Traits
int generation;
public static Target FromPos(WPos p) { return new Target { pos = p, type = TargetType.Terrain }; }
public static Target FromCell(World w, CPos c) { return new Target { pos = w.Map.CenterOfCell(c), type = TargetType.Terrain }; }
public static Target FromCell(World w, CPos c, int subCell = 0)
{
return new Target { pos = w.Map.CenterOfCell(c) + w.Map.SubCellOffsets[subCell], type = TargetType.Terrain };
}
public static Target FromOrder(World w, Order o)
{
return o.TargetActor != null