[Add] Added more price checks.

This commit is contained in:
Allanis 2014-03-10 18:10:58 +00:00
parent 5bda353312
commit cf9567d79f

View File

@ -417,7 +417,7 @@ static int outfit_canBuy(Outfit* outfit, int q, int errmsg) {
return 0;
}
/* Not enough $$. */
else if(q*outfit->price >= player->credits) {
else if(q*outfit->price > player->credits) {
if(errmsg != 0) {
credits2str(buf, q*outfit->price - player->credits, 2);
dialogue_alert("You need %s more SCred.", buf);
@ -679,6 +679,12 @@ static void shipyard_buy(unsigned int wid, char* str) {
shipname = toolkit_getList(wid, "iarShipyard");
ship = ship_get(shipname);
/* Must have enough money. */
if(ship->price > player->credits) {
dialogue_alert("Not enough credits!");
return;
}
if(pilot_cargoUsed(player) > ship->cap_cargo) {
dialogue_alert("You won't have space to move your current cargo onto the new ship.");
return;