Replace Cash + Resources with GetCashAndResources()
This commit is contained in:
@@ -50,7 +50,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public override int GetSelectionShares(Actor collector)
|
||||
{
|
||||
var pr = collector.Owner.PlayerActor.Trait<PlayerResources>();
|
||||
if (info.Amount < 0 && pr.Cash + pr.Resources == 0)
|
||||
if (info.Amount < 0 && pr.GetCashAndResources() == 0)
|
||||
return 0;
|
||||
|
||||
return base.GetSelectionShares(collector);
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
else
|
||||
{
|
||||
// Don't put the player into negative funds
|
||||
amount = Math.Max(-(Cash + Resources), amount);
|
||||
amount = Math.Max(-GetCashAndResources(), amount);
|
||||
|
||||
TakeCash(-amount);
|
||||
}
|
||||
@@ -182,7 +182,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public bool TakeCash(int num, bool notifyLowFunds = false)
|
||||
{
|
||||
if (Cash + Resources < num)
|
||||
if (GetCashAndResources() < num)
|
||||
{
|
||||
if (notifyLowFunds && Game.RunTime > lastNotificationTime + Info.InsufficientFundsNotificationInterval)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user