This commit is contained in:
Chris Forbes
2009-12-05 22:20:41 +13:00
parent dfbf299055
commit 2de5ec4b3a
3 changed files with 14 additions and 4 deletions

View File

@@ -63,7 +63,17 @@ namespace OpenRa.Game
}
public void GiveCash( int num ) { Cash += num; }
public void GiveOre(int num) { Ore += num; }
public void GiveOre(int num)
{
Ore += num;
var capacity = GetOreCapacity();
if (Ore > capacity)
Ore = capacity; // trim off the overflow.
if (Ore > .8 * capacity)
Sound.Play("silond1.aud");
}
public bool TakeCash( int num )
{