Suppress negative cash crate action if the collector has no cash.

This commit is contained in:
Paul Chote
2018-05-07 11:57:07 +01:00
committed by reaperrr
parent bf4dbd9b80
commit c65d6d1484

View File

@@ -47,5 +47,14 @@ namespace OpenRA.Mods.Common.Traits
base.Activate(collector);
}
public override int GetSelectionShares(Actor collector)
{
var pr = collector.Owner.PlayerActor.Trait<PlayerResources>();
if (info.Amount < 0 && (pr.Cash + pr.Resources) == 0)
return 0;
return base.GetSelectionShares(collector);
}
}
}