cargo: don't crash.
This commit is contained in:
@@ -15,12 +15,14 @@ namespace OpenRa.Game.Traits
|
||||
|
||||
public Order IssueOrder(Actor self, int2 xy, MouseInput mi, Actor underCursor)
|
||||
{
|
||||
var unit = underCursor.traits.GetOrDefault<Unit>();
|
||||
if (unit.Altitude > 0) return null;
|
||||
|
||||
// todo: check if there is an unoccupied `land` tile adjacent
|
||||
if (mi.Button == MouseButton.Right && underCursor == self && cargo.Count > 0)
|
||||
{
|
||||
var unit = underCursor.traits.GetOrDefault<Unit>();
|
||||
if (unit != null && unit.Altitude > 0) return null;
|
||||
|
||||
return new Order("Deploy", self, null, int2.Zero, null);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user