- quick patches, attempt at fixing a few crashes
This commit is contained in:
wagic.the.homebrew@gmail.com
2010-03-13 08:48:40 +00:00
parent 8a4797a06a
commit fa0d98988d
5 changed files with 15 additions and 11 deletions

View File

@@ -199,7 +199,7 @@ void GameStateShop::cancelCard(int controlId){
//Update prices
MTGCard * c = srcCards->getCard(controlId-BOOSTER_SLOTS);
if(!c || !c->data || playerdata->credits - mPrices[controlId] < 0)
return; //We only care about their oppinion if they /can/ buy it.
return; //We only care about their opinion if they /can/ buy it.
int price = mPrices[controlId];
int rnd;
@@ -212,7 +212,8 @@ void GameStateShop::cancelCard(int controlId){
rnd = rand() % 25; break;
}
price = price - (rnd * price)/100;
pricelist->setPrice(c->getMTGId(),price);
if (price < pricelist->getPrice(c->getMTGId())) //filters have a tendancy to increase the price instead of lowering it!
pricelist->setPrice(c->getMTGId(),price);
//Prices do not immediately go down when you ignore something.
return;
}