Fixed Mobile.SetPosition & other FixUnloadCargo touch-ups

Fixed Mobile.SetPosition
Finally removed old SubCell enum
Folded MobileInfo.CanEnterCell overloads into one
Renamed IPositionable.{IsMovingFrom => IsLeaving}
Changed Crate.IsLeaving to use crate lifetime
This commit is contained in:
atlimit8
2014-08-10 20:31:35 -05:00
parent b2c9064545
commit 27ad5208fb
7 changed files with 19 additions and 28 deletions

View File

@@ -180,7 +180,7 @@ namespace OpenRA.Traits
public interface IPositionable : IOccupySpace
{
bool IsMovingFrom(CPos location, int subCell = -1);
bool IsLeaving(CPos location, int subCell = -1);
bool CanEnterCell(CPos location, Actor ignoreActor = null, bool checkTransientActors = true);
int GetAvailableSubcell(CPos location, int preferredSubCell = -1, Actor ignoreActor = null, bool checkTransientActors = true);
void SetPosition(Actor self, CPos cell, int subCell = -1);

View File

@@ -14,8 +14,6 @@ using System.Linq;
namespace OpenRA.Traits
{
public enum SubCell { FullCell, TopLeft, TopRight, Center, BottomLeft, BottomRight }
public class ActorMapInfo : ITraitInfo
{
[Desc("Size of partition bins (cells)")]
@@ -131,7 +129,7 @@ namespace OpenRA.Traits
if (checkTransient)
return true;
var pos = i.Actor.TraitOrDefault<IPositionable>();
if (pos == null || !pos.IsMovingFrom(a, i.SubCell))
if (pos == null || !pos.IsLeaving(a, i.SubCell))
return true;
}