Refactored [sub-]cell availability logic in IPositionable & ActorMap
Moved the logic from IPositionable.CanEnterCell & integrated sub-cell selection.
Added IPositionable.IsMovingFrom(CPos location, int subCell = -1) - to detect transient actors
Renamed IPositionable.{GetDesiredSubcell => GetAvailableSubcell} - since it checks for available sub-cells
Reduced IPositionable.CanEnterCell to one method that usually uses IPositionable.GetAvailableSubcell
Added actor checking to ActorMap.{HasFreeSubCell, FreeSubCell, AnyUnitsAt} - used by [sub-]cell availability logic
This commit is contained in:
@@ -245,7 +245,7 @@ namespace OpenRA.Mods.RA.Move
|
||||
hasWaited = false;
|
||||
path.RemoveAt(path.Count - 1);
|
||||
|
||||
var subCell = mobile.GetDesiredSubcell(nextCell, ignoreBuilding);
|
||||
var subCell = mobile.GetAvailableSubcell(nextCell, -1, ignoreBuilding);
|
||||
return Pair.New(nextCell, subCell);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user